forked from Martlark/pg_dump
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
44 lines (41 loc) · 1.26 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
version: "3.9"
services:
database:
image: postgres:12.16
volumes:
- ./persistent/data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=SumPassw0rdHere
- POSTGRES_DB=db
restart: unless-stopped
backup:
image: martlark/pg_dump:12.16
container_name: postgres-backup
environment:
- PGPASSWORD=SumPassw0rdHere
- PGDB=db # The name of the database to dump
- PGHOST=database # The hostname of the PostgreSQL database to dump
- CRON_SCHEDULE=0 3 * * * # Every day at 3am
- RETAIN_COUNT=1 # Keep this number of backups
volumes:
- ./persistent/data:/dump
database-15-2:
image: postgres:15.2
volumes:
- ./persistent/data-15-2:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=SumPassw0rdHere
- POSTGRES_DB=db
restart: unless-stopped
backup-15-2:
image: martlark/pg_dump:15.2
depends_on:
- database-15-2
environment:
- PGPASSWORD=SumPassw0rdHere
- PGDB=db # The name of the database to dump
- PGHOST=database-15-2 # The hostname of the PostgreSQL database to dump
- CRON_SCHEDULE=0 3 * * * # Every day at 3am
- RETAIN_COUNT=1 # Keep this number of backups
volumes:
- ./persistent/data-15-2:/dump