-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose-swarm.yml
90 lines (82 loc) · 1.9 KB
/
docker-compose-swarm.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
version: '3'
services:
ttrss:
image: schemen/ttrss-app:latest
command: web
volumes:
- ttrss-data:/data
networks:
- internal
worker:
image: schemen/ttrss-app:latest
command: worker
volumes:
- ttrss-data:/data
networks:
- internal
updater:
image: schemen/ttrss-app:latest
command: updater
volumes:
- ttrss-data:/data
networks:
- internal
nginx:
image: schemen/ttrss-nginx:latest
## Uncomment if you don't want to use traefik, be aware that it is not HTTPS
#ports:
# - "8080:80"
volumes:
- ttrss-data:/data
deploy:
replicas: 1
## These are labels for Traefik to know how to proxy to the nginx container
labels:
- traefik.frontend.rule=Host:rss.example.com
- traefik.docker.network=traefik_public
- traefik.port=80
networks:
- internal
- traefik_public
db:
image: postgres:latest
volumes:
- db:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=password
- POSTGRES_USER=ttrss
- POSTGRES_DB=ttrss
networks:
- internal
db-backup:
image: postgres:latest
environment:
- POSTGRES_PASSWORD=password
- POSTGRES_USER=ttrss
- POSTGRES_DB=ttrss
volumes:
- db-backup:/dump
- /etc/localtime:/etc/localtime:ro
entrypoint: |
bash -c 'bash -s <<EOF
trap "break;exit" SIGHUP SIGINT SIGTERM
sleep 2m
while /bin/true; do
pg_dump -Fc > /dump/dump_\`date +%d-%m-%Y"_"%H_%M_%S\`.psql
(ls -t /dump/dump*.psql|head -n $$BACKUP_NUM_KEEP;ls /dump/dump*.psql)|sort|uniq -u|xargs rm -- {}
sleep $$BACKUP_FREQUENCY
done
EOF'
networks:
- internal
volumes:
ttrss-data:
db:
db-backup:
networks:
traefik_public:
external: true
internal:
## Uncomment if you want encrypted overlay traffic
# driver_opts:
# encrypted: ""