57 lines
1 KiB
YAML
57 lines
1 KiB
YAML
services:
|
|
www:
|
|
image: farmos/farmos:3.2.2
|
|
volumes:
|
|
- www:/opt/drupal/web/sites
|
|
ports: []
|
|
#- '80:80'
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- db
|
|
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
|
|
db:
|
|
image: postgres:13
|
|
volumes:
|
|
- db:/var/lib/postgresql/data
|
|
ports: []
|
|
#- '5432:5432'
|
|
environment:
|
|
POSTGRES_USER:
|
|
POSTGRES_PASSWORD:
|
|
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:
|
|
|
|
volumes:
|
|
www:
|
|
db:
|