Files
nginx_prod/docker-compose.yaml

93 lines
3.0 KiB
YAML

services:
nginx:
image: git.limbosolutions.com/kb/nginx-geoip:latest
volumes:
- nginx-conf.d:/etc/nginx/conf.d
- letsencrypt-conf:/etc/letsencrypt
- certbot-www:/var/www/certbot
ports:
- 443:443
- 80:80
#- 8080:8080
- 2222:2222
networks:
- wan_reverse_proxy_public
- private
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
restart: unless-stopped
certbot:
image: certbot/certbot
entrypoint: /bin/sh
command: -c "/scripts/refresh-certs"
volumes:
- letsencrypt-conf:/etc/letsencrypt
- certbot-www:/var/www/certbot
- certbot-scripts:/scripts
restart: unless-stopped
rclone:
image: rclone/rclone
volumes:
- letsencrypt-conf:/etc/letsencrypt #must be on same place as cerbot container for symbolic links work
environment:
- SLEEP=1d
- RCLONE_CONFIG_HOT_LIMBOSOLUTIONS_TYPE=s3
- RCLONE_CONFIG_HOT_LIMBOSOLUTIONS_PROVIDER=Minio
- RCLONE_CONFIG_HOT_LIMBOSOLUTIONS_ENDPOINT=${RCLONE_CONFIG_HOT_LIMBOSOLUTIONS_ENDPOINT}
- RCLONE_CONFIG_HOT_LIMBOSOLUTIONS_ACCESS_KEY_ID=${RCLONE_CONFIG_HOT_LIMBOSOLUTIONS_ACCESS_KEY_ID}
- RCLONE_CONFIG_HOT_LIMBOSOLUTIONS_SECRET_ACCESS_KEY=${RCLONE_CONFIG_HOT_LIMBOSOLUTIONS_SECRET_ACCESS_KEY}
- RCLONE_CONFIG_ENCRYPTED_TYPE=crypt
- RCLONE_CONFIG_ENCRYPTED_REMOTE=${RCLONE_CONFIG_ENCRYPTED_REMOTE}
- RCLONE_CONFIG_ENCRYPTED_PASSWORD=${RCLONE_CONFIG_ENCRYPTED_PASSWORD}
entrypoint: /bin/sh
command: |
-c
'
echo "$$(date "'"+%Y-%m-%d %H:%M:%S"'") INFO : Container started!"
export RCLONE_CONFIG_ENCRYPTED_PASSWORD=`rclone obscure "$${RCLONE_CONFIG_ENCRYPTED_PASSWORD}"`
while :;
do
echo "$$(date "'"+%Y-%m-%d %H:%M:%S"'") INFO : Doing Work!"
rclone copy /etc/letsencrypt/live encrypted:letsencrypt_live --copy-links -v
echo "$$(date "'"+%Y-%m-%d %H:%M:%S"'") INFO : Work ended."
echo "$$(date "'"+%Y-%m-%d %H:%M:%S"'") INFO : Going to sleep for $${SLEEP}."
sleep $${SLEEP} & wait $${!}
echo "$$(date "'"+%Y-%m-%d %H:%M:%S"'") INFO : Wake from sleep!"
done
'
restart: unless-stopped
duplicati:
image: duplicati-mysqlclient:latest
command: /usr/bin/duplicati-server --webservice-port=8200 --webservice-interface=any --webservice-allowed-hostnames=*
volumes:
- duplicati_tmpdata:/data
- nginx-conf.d:/bck/nginx-conf.d
- letsencrypt-conf:/bck/letsencrypt-conf
- certbot-www:/bck/certbot-www
- duplicati_tmpdata:/bck/duplicati_tmpdata
- certbot-scripts:/bck/certbot-scripts
ports:
- 8205:8200
networks:
- private
- wan_reverse_proxy_public
restart: unless-stopped
volumes:
certbot-scripts:
nginx-conf.d:
letsencrypt-conf:
certbot-www:
duplicati_tmpdata:
telegraf-etc:
networks:
wan_reverse_proxy_public:
external: true
private: