huginn/docker-compose.yml

94 lines
2.3 KiB
YAML
Raw Normal View History

2020-05-11 18:50:54 +00:00
version: '3'
services:
huginn:
2020-05-11 18:53:19 +00:00
deploy:
placement:
constraints: [node.labels.com.sigyl.git-stack == yes]
replicas: 1
restart_policy:
condition: any
2020-05-11 18:50:54 +00:00
image: huginn/huginn
environment:
# For huginn/huginn - essential
- SMTP_DOMAIN=your-domain-here.com
- SMTP_USER_NAME=you@gmail.com
- SMTP_PASSWORD=somepassword
- SMTP_SERVER=your-mailserver-here.com
- SMTP_PORT=587
- SMTP_AUTHENTICATION=plain
- SMTP_ENABLE_STARTTLS_AUTO=true
- INVITATION_CODE=<set an invitation code here>
- POSTGRES_PORT_5432_TCP_ADDR=db
- POSTGRES_PORT_5432_TCP_PORT=5432
- DATABASE_USERNAME=huginn
- DATABASE_PASSWORD=<database password>
- DATABASE_ADAPTER=postgresql
volumes:
- /etc/localtime:/etc/localtime:ro
networks:
- appnet
- externalnet
db:
2020-05-11 18:53:19 +00:00
deploy:
placement:
constraints: [node.labels.com.sigyl.git-stack-data == yes]
replicas: 1
restart_policy:
condition: any
2020-05-11 18:50:54 +00:00
environment:
- POSTGRES_USER=huginn
- POSTGRES_PASSWORD=<database password>
- BACKUP_NUM_KEEP=7
- BACKUP_FREQUENCY=1d
image: postgres:latest
volumes:
- db:/var/lib/postgresql/data
- /etc/localtime:/etc/localtime:ro
networks:
- appnet
- externalnet
db-backup:
2020-05-11 18:53:19 +00:00
deploy:
placement:
constraints: [node.labels.com.sigyl.git-stack-data == yes]
replicas: 1
restart_policy:
condition: any
2020-05-11 18:50:54 +00:00
image: postgres:latest
environment:
- POSTGRES_USER=huginn
- POSTGRES_PASSWORD=<database password>
- BACKUP_NUM_KEEP=7
- BACKUP_FREQUENCY=1d
volumes:
- db-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:
- appnet
- externalnet
volumes:
db:
db-dump:
networks:
externalnet:
external: true
driver: overlay
appnet:
driver: overlay