docker-mirror/docker-compose.yml

68 lines
2.4 KiB
YAML

version: "3.7"
services:
nginx:
image: nginx
container_name: nginx
hostname: ${DOMAIN_NAME:?err}
volumes:
- './http-root:/var/lib/nginx/html/http-root:ro'
- './data/acme-webroot:/var/lib/nginx/html/acme:ro'
- './data/letsencrypt/etc:/etc/letsencrypt:ro'
- './preset/nginx.conf:/etc/nginx/nginx.conf:ro'
- './preset/conf.d:/etc/nginx/conf.d:ro'
labels:
com.datadoghq.ad.check_names: '["nginx"]'
com.datadoghq.ad.init_configs: '[{}]'
com.datadoghq.ad.instances: '[{"nginx_status_url": "http://%%host%%:81/nginx_status/"}]'
ports:
- '80:80'
- '443:443'
restart: ${RESTART:-unless-stopped}
syncthing:
image: syncthing/syncthing:latest
container_name: syncthing
hostname: ${DOMAIN_NAME:?err}
environment:
- PUID=1000
- PGID=1000
volumes:
- './data/syncthing:/var/syncthing/config'
- './http-root/chaotic-aur:/repo'
ports:
- '127.0.0.1:8384:8384'
- 22000:22000/tcp
- 22000:22000/udp
- 21027:21027/udp
restart: ${RESTART:-unless-stopped}
chaotic-management:
container_name: chaotic-management
restart: ${RESTART:-unless-stopped}
image: nginx
volumes:
- './data:/data'
entrypoint:
- /bin/sh
- -c
- |
trap exit TERM INT;
sleep 10;
while :; do
apikey="$$(grep -oPm 1 '(?<=\<apikey\>).*(?=\</apikey\>)' /data/syncthing/config.xml)"
curl -s --fail -X POST -H "X-API-Key: $$apikey" http://syncthing:8384/rest/db/revert?folder=jhcrt-m2dra || echo Failed to revert folder;
sed -i -r '/<device id="ZDHVMSP-EW4TMWX-DBH2W4P-HV5A6OY-BBEFABO-QTENANJ-RJ6GKNX-6KCG7QY"/! s|(^ *<device .*id="[^"]+".*skipIntroductionRemovals="false".*introducedBy=")(">)|\1ZDHVMSP-EW4TMWX-DBH2W4P-HV5A6OY-BBEFABO-QTENANJ-RJ6GKNX-6KCG7QY\2|' /data/syncthing/config.xml
sleep 1h &
wait $${!};
done;
certbot:
image: certbot/certbot:${LETSENCRYPT_TAG:-latest}
container_name: certbot
volumes:
- './data/acme-webroot:/srv/http/webroot'
- './data/letsencrypt/etc:/etc/letsencrypt'
- './data/letsencrypt/var:/var/lib/letsencrypt'
entrypoint: "/bin/sh -c 'trap exit TERM; sleep 10; while :; do certbot renew -w /srv/http/webroot/ --webroot; sleep 12h & wait $${!}; done;'"
restart: ${RESTART:-unless-stopped}