AdguardTeam / AdguardTeam/AdGuardHome

Folder Structure Restricts use of Volumes in Docker Compose

Abierto
#6,537 0 comentarios 1 reacción 0 asignados Ver en GitHub
feature request
Lenguaje dominante
TypeScript
Estrellas
36.9k
Forks
2.5k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

### Prerequisites

- [X] I have checked the [Wiki](https://github.com/AdguardTeam/AdGuardHome/wiki) and [Discussions](https://github.com/AdguardTeam/AdGuardHome/discussions) and found no answer

- [X] I have searched other issues and found no duplicates

- [X] I want to request a feature or enhancement and not ask a question

### The problem

Unable to use volumes in a docker-compose.yml as it uses a single path to redirect generated data. Volumes are the preferred method suggested by Docker, and is needed in order to follow proper backup and migration procedures. AdGuard Home currently suggest/uses Bind Mounts.

> "Volumes are the preferred mechanism for persisting data generated by and used by Docker containers. While [bind mounts] are dependent on the directory structure and OS of the host machine, volumes are completely managed by Docker. Volumes have several advantages over bind mounts." -https://docs.docker.com/storage/volumes/

Currently, you would need to point the volume to `/opt/adguardhome' where generated data is stored in 2 folders alongside the application/entrypoint that needs to remain in the container. This causes the issue.

```
/opt/adguardhome/conf
/opt/adguardhome/work
/opt/adguardhome/AdGuardHome #Application/Entrypoint.
```

AdGuard Home Documention for Docker; uses Bind Mounts.
```
docker run --name adguardhome\
--restart unless-stopped\
-v /my/own/workdir:/opt/adguardhome/work\
-v /my/own/confdir:/opt/adguardhome/conf\
-p 53:53/tcp -p 53:53/udp\
-p 67:67/udp -p 68:68/udp\
-p 80:80/tcp -p 443:443/tcp -p 443:443/udp -p 3000:3000/tcp\
-p 853:853/tcp\
-p 784:784/udp -p 853:853/udp -p 8853:8853/udp\
-p 5443:5443/tcp -p 5443:5443/udp\
-d adguard/adguardhome
```

### Proposed solution

Move the 2 folders containing the generated data, into a single folder that can be referenced in a docker-compose.yml file providing a single path of `/opt/adguardhome/data' needed to redirect only the generated data to a volume.

```
/opt/adguardhome/data/conf
/opt/adguardhome/data/work
/opt/adguardhome/AdGuardHome #Application/Entrypoint
```

Example of a working docker-compose.yml file, with the change, using volumes.

```
version: "3"
services:
adguardhome:
container_name: adguard-home
image: adguard/adguardhome:latest
ports:
- "53:53/tcp"
- "53:53/udp"
- "80:80/tcp"
- "443:443/tcp"
- "3000:3000/tcp"
- "6060:6060/tcp"
restart: unless-stopped
volumes:
- data:/opt/adguardhome/data

volumes:
data:
```

### Alternatives considered and additional information

_No response_

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.