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