Compare commits
3 Commits
51a7aae379
...
e5513e9358
| Author | SHA1 | Date | |
|---|---|---|---|
| e5513e9358 | |||
| 717d3a87d0 | |||
| ed60abf96f |
7
conf/rsync-conf/excludes.txt
Normal file
7
conf/rsync-conf/excludes.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
*.tmp
|
||||||
|
*.log
|
||||||
|
cache/
|
||||||
|
temp/
|
||||||
|
*.lock
|
||||||
|
lost+found/
|
||||||
|
traefik/certificates/acme.json
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
services:
|
|
||||||
freefilesync:
|
|
||||||
image: jlesage/freefilesync
|
|
||||||
networks:
|
|
||||||
- homelab
|
|
||||||
ports:
|
|
||||||
- "5800:5800"
|
|
||||||
volumes:
|
|
||||||
- /home/doc/swarm-data/appdata/freefilesync:/config
|
|
||||||
- /home/doc/swarm-data/appdata:/storage
|
|
||||||
- /home/doc/swarm/appdata:/nfs/appdata
|
|
||||||
deploy:
|
|
||||||
replicas: 1
|
|
||||||
placement:
|
|
||||||
constraints:
|
|
||||||
- node.hostname == p0
|
|
||||||
networks:
|
|
||||||
homelab:
|
|
||||||
external: true
|
|
||||||
26
stacks/data/rsync/stack.yml
Normal file
26
stacks/data/rsync/stack.yml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
services:
|
||||||
|
rsync:
|
||||||
|
image: alpine:latest
|
||||||
|
user: "0:0"
|
||||||
|
command: >
|
||||||
|
sh -c "
|
||||||
|
apk add --no-cache rsync &&
|
||||||
|
echo '0 2 * * * rsync -av --no-perms --no-owner --no-group --exclude-from=/excludes.txt /source/ /destination/ && echo \"Sync completed at $$(date)\"' | crontab - &&
|
||||||
|
echo 'Backup sync started. Daily sync at 2 AM.' &&
|
||||||
|
crond -f -l 2"
|
||||||
|
deploy:
|
||||||
|
replicas: 1
|
||||||
|
restart_policy:
|
||||||
|
condition: on-failure
|
||||||
|
delay: 30s
|
||||||
|
placement:
|
||||||
|
constraints: [node.role == manager]
|
||||||
|
volumes:
|
||||||
|
- /home/doc/swarm-data/appdata:/source:ro
|
||||||
|
- /home/doc/swarm/appdata:/destination
|
||||||
|
- /home/doc/swarm/swarm-production/conf/rsync-conf/excludes.txt:/excludes.txt:ro
|
||||||
|
networks:
|
||||||
|
- homelab
|
||||||
|
networks:
|
||||||
|
homelab:
|
||||||
|
external: true
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
services:
|
|
||||||
nginx:
|
|
||||||
image: nginx:alpine
|
|
||||||
hostname: nginx
|
|
||||||
networks:
|
|
||||||
- caddy
|
|
||||||
ports:
|
|
||||||
- target: 80
|
|
||||||
published: 8080
|
|
||||||
mode: host
|
|
||||||
deploy:
|
|
||||||
replicas: 1
|
|
||||||
labels:
|
|
||||||
caddy: test.frostlabs.me
|
|
||||||
caddy.reverse_proxy: "nginx:80"
|
|
||||||
caddy.tls.dns: cloudflare
|
|
||||||
restart_policy:
|
|
||||||
condition: on-failure
|
|
||||||
|
|
||||||
networks:
|
|
||||||
caddy:
|
|
||||||
external: true
|
|
||||||
@@ -10,7 +10,7 @@ services:
|
|||||||
- /home/doc/swarm-data/appdata/webservers/production/nginx/.conf/default.conf:/etc/nginx/conf.d/default.conf:ro
|
- /home/doc/swarm-data/appdata/webservers/production/nginx/.conf/default.conf:/etc/nginx/conf.d/default.conf:ro
|
||||||
- /home/doc/swarm-data/appdata/webfiles/production/taylors-development:/usr/share/nginx/html:ro
|
- /home/doc/swarm-data/appdata/webfiles/production/taylors-development:/usr/share/nginx/html:ro
|
||||||
deploy:
|
deploy:
|
||||||
replicas: 3
|
replicas: 1
|
||||||
placement:
|
placement:
|
||||||
constraints:
|
constraints:
|
||||||
- node.role == worker
|
- node.role == worker
|
||||||
|
|||||||
Reference in New Issue
Block a user