From ef4246b55cdf9eaa6c12154e8aa3ed3b9df4a4c2 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 25 May 2020 19:10:05 +0200 Subject: [PATCH] services: add Syncthing --- docker-compose.yml | 16 +++++++++ .../proxy-confs/syncthing.subdomain.conf | 33 +++++++++++++++++++ syncthing/syncthing.env | 4 +++ 3 files changed, 53 insertions(+) create mode 100644 letsencrypt/nginx/proxy-confs/syncthing.subdomain.conf create mode 100644 syncthing/syncthing.env diff --git a/docker-compose.yml b/docker-compose.yml index 0a250c8..9ed21da 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -297,3 +297,19 @@ services: - 2342 - 2343 user: 1000:1000 + + syncthing: + image: linuxserver/syncthing + restart: unless-stopped + container_name: syncthing + restart: unless-stopped + env_file: + - ./syncthing/syncthing.env + volumes: + - ./syncthing:/config + - ~/:/data1 + expose: + - 8384 + ports: + - 22000:22000 + - 21027:21027/udp diff --git a/letsencrypt/nginx/proxy-confs/syncthing.subdomain.conf b/letsencrypt/nginx/proxy-confs/syncthing.subdomain.conf new file mode 100644 index 0000000..a674ff6 --- /dev/null +++ b/letsencrypt/nginx/proxy-confs/syncthing.subdomain.conf @@ -0,0 +1,33 @@ +# make sure that your dns has a cname set for syncthing and that your syncthing container is not using a base url + +server { + listen 443 ssl; + listen [::]:443 ssl; + + server_name syncthing.*; + + include /config/nginx/ssl.conf; + + client_max_body_size 0; + + # enable for ldap auth, fill in ldap details in ldap.conf + #include /config/nginx/ldap.conf; + + location / { + # enable the next two lines for http auth + #auth_basic "Restricted"; + #auth_basic_user_file /config/nginx/.htpasswd; + + # enable the next two lines for ldap auth + #auth_request /auth; + #error_page 401 =200 /login; + + include /config/nginx/proxy.conf; + resolver 127.0.0.11 valid=30s; + set $upstream_app syncthing; + set $upstream_port 8384; + set $upstream_proto http; + proxy_pass $upstream_proto://$upstream_app:$upstream_port; + + } +} diff --git a/syncthing/syncthing.env b/syncthing/syncthing.env new file mode 100644 index 0000000..7cf70ac --- /dev/null +++ b/syncthing/syncthing.env @@ -0,0 +1,4 @@ +PUID=1000 +PGID=1000 +TZ=Europe/Paris +UMASK_SET=022