doker-compose
This commit is contained in:
parent
93bc6c563e
commit
34e0e8f1a7
|
@ -0,0 +1,75 @@
|
|||
version: '3'
|
||||
|
||||
services:
|
||||
|
||||
huginn:
|
||||
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:
|
||||
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:
|
||||
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
|
Loading…
Reference in New Issue