mirror of
https://github.com/funkypenguin/geek-cookbook/
synced 2025-12-16 03:06:28 +00:00
Add Huginn backups
This commit is contained in:
@@ -71,23 +71,45 @@ services:
|
|||||||
|
|
||||||
huginn:
|
huginn:
|
||||||
image: huginn/huginn
|
image: huginn/huginn
|
||||||
env_file: /var/data/huginn/huginn.env
|
env_file: /var/data/config/huginn/huginn.env
|
||||||
|
volumes:
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
- traefik
|
- traefik
|
||||||
deploy:
|
deploy:
|
||||||
labels:
|
labels:
|
||||||
- traefik.frontend.rule=Host:huginn.example.com
|
- traefik.frontend.rule=Host:huginn.funkypenguin.co.nz
|
||||||
- traefik.docker.network=traefik
|
- traefik.docker.network=traefik
|
||||||
- traefik.port=3000
|
- traefik.port=3000
|
||||||
|
|
||||||
db:
|
db:
|
||||||
env_file: /var/data/huginn/huginn.env
|
env_file: /var/data/config/huginn/huginn.env
|
||||||
image: postgres:latest
|
image: postgres:latest
|
||||||
volumes:
|
volumes:
|
||||||
- /var/data/huginn/database:/var/lib/postgresql/data
|
- /var/data/runtime/huginn/database:/var/lib/postgresql/data
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
|
|
||||||
|
db-backup:
|
||||||
|
image: postgres:latest
|
||||||
|
env_file: /var/data/config/huginn/huginn.env
|
||||||
|
volumes:
|
||||||
|
- /var/data/huginn/database-dump:/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
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
traefik:
|
traefik:
|
||||||
|
|||||||
Reference in New Issue
Block a user