From 34e0e8f1a7968e5ce1d23732accd4f2affb4e581 Mon Sep 17 00:00:00 2001 From: Giles Bradshaw Date: Mon, 11 May 2020 19:50:54 +0100 Subject: [PATCH] doker-compose --- docker-compose.yml | 75 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5d47b7b --- /dev/null +++ b/docker-compose.yml @@ -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= + - POSTGRES_PORT_5432_TCP_ADDR=db + - POSTGRES_PORT_5432_TCP_PORT=5432 + - DATABASE_USERNAME=huginn + - DATABASE_PASSWORD= + - DATABASE_ADAPTER=postgresql + volumes: + - /etc/localtime:/etc/localtime:ro + networks: + - appnet + - externalnet + + db: + environment: + - POSTGRES_USER=huginn + - POSTGRES_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= + - BACKUP_NUM_KEEP=7 + - BACKUP_FREQUENCY=1d + volumes: + - db-dump:/dump + - /etc/localtime:/etc/localtime:ro + entrypoint: | + bash -c 'bash -s < /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