2024-06-12 22:44:21 -04:00
|
|
|
services:
|
|
|
|
www:
|
|
|
|
image: farmos/farmos:3.2.2
|
|
|
|
volumes:
|
|
|
|
- www:/opt/drupal/web/sites
|
|
|
|
ports: []
|
|
|
|
#- '80:80'
|
|
|
|
restart: unless-stopped
|
|
|
|
depends_on:
|
|
|
|
- db
|
2024-06-23 17:59:19 -04:00
|
|
|
www-backup:
|
|
|
|
profiles:
|
|
|
|
- backup
|
|
|
|
image: busybox
|
|
|
|
command:
|
|
|
|
- /bin/sh
|
|
|
|
- -c
|
|
|
|
- |
|
|
|
|
tar -cvzf /backup/www.$(date -u -Is).tgz -C /www .
|
|
|
|
volumes:
|
|
|
|
- www:/www
|
|
|
|
- ./backup:/backup
|
2024-06-12 22:44:21 -04:00
|
|
|
db:
|
|
|
|
image: postgres:13
|
|
|
|
volumes:
|
|
|
|
- db:/var/lib/postgresql/data
|
|
|
|
ports: []
|
|
|
|
#- '5432:5432'
|
|
|
|
environment:
|
2024-06-23 17:59:19 -04:00
|
|
|
POSTGRES_USER:
|
2024-06-12 22:44:21 -04:00
|
|
|
POSTGRES_PASSWORD:
|
2024-06-23 17:59:19 -04:00
|
|
|
POSTGRES_DB:
|
|
|
|
db-backup:
|
|
|
|
profiles:
|
|
|
|
- backup
|
|
|
|
image: postgres:13
|
|
|
|
volumes:
|
|
|
|
- db:/var/lib/postgresql/data
|
|
|
|
- ./backup:/backup
|
|
|
|
command:
|
|
|
|
- /bin/sh
|
|
|
|
- -c
|
|
|
|
- |
|
|
|
|
pg_dump \
|
|
|
|
-U ${POSTGRES_USER} \
|
|
|
|
-d ${POSTGRES_DB} \
|
|
|
|
-h db \
|
|
|
|
-F c -b -v \
|
|
|
|
-f /backup/db.$(date -u -Is).psql
|
|
|
|
environment:
|
|
|
|
POSTGRES_USER:
|
|
|
|
PGPASSWORD: ${POSTGRES_PASSWORD}
|
|
|
|
POSTGRES_DB:
|
2024-06-12 22:44:21 -04:00
|
|
|
|
|
|
|
volumes:
|
|
|
|
www:
|
|
|
|
db:
|