update
This commit is contained in:
parent
acbeb51f72
commit
2c86f1bcc7
|
@ -23,17 +23,14 @@ Written in Go.
|
|||
└── ~/
|
||||
└── docker/
|
||||
└── syncthing/
|
||||
├── 🗋 .env
|
||||
└── 🗋 docker-compose.yml
|
||||
```
|
||||
* `.env` - a file containing environment variables for docker compose
|
||||
* `docker-compose.yml` - a docker compose file, telling docker how to run the container
|
||||
|
||||
# Compose
|
||||
|
||||
Of note is use of `network_mode: host` as the official documentation
|
||||
recommends.
|
||||
What it means is that the container is running straight on docker host IP,
|
||||
is solely in charge of ports it has inernaly defined.
|
||||
|
||||
`docker-compose.yml`
|
||||
```yml
|
||||
services:
|
||||
|
@ -43,9 +40,7 @@ services:
|
|||
container_name: syncthing
|
||||
hostname: syncthing
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
env_file: .env
|
||||
volumes:
|
||||
- /mnt/mirror/syncthing:/var/syncthing
|
||||
network_mode: host
|
||||
|
@ -54,6 +49,22 @@ services:
|
|||
- 22000:22000/tcp # TCP file transfers
|
||||
- 22000:22000/udp # QUIC file transfers
|
||||
- 21027:21027/udp # Receive local discovery broadcasts
|
||||
|
||||
networks:
|
||||
default:
|
||||
name: $DOCKER_MY_NETWORK
|
||||
external: true
|
||||
```
|
||||
|
||||
`.env`
|
||||
```bash
|
||||
# GENERAL
|
||||
DOCKER_MY_NETWORK=caddy_net
|
||||
TZ=Europe/Bratislava
|
||||
|
||||
# SYNCTHING
|
||||
PUID=1000
|
||||
PGID=1000
|
||||
```
|
||||
|
||||
# Reverse proxy
|
||||
|
@ -61,15 +72,11 @@ services:
|
|||
Caddy v2 is used, details
|
||||
[here](https://github.com/DoTheEvo/selfhosted-apps-docker/tree/master/caddy_v2).
|
||||
|
||||
Since using the host network_mode caddy can't use hostname as it wont resolve,
|
||||
so docker host IP is just used straight up, with the port for web gui.
|
||||
|
||||
`Caddyfile`
|
||||
```php
|
||||
sync.{$MY_DOMAIN} {
|
||||
reverse_proxy 10.0.19.4:8384
|
||||
reverse_proxy syncthing:8384
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
# First run
|
||||
|
|
Loading…
Reference in New Issue