-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
53 lines (52 loc) · 1.79 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
45
46
47
48
49
50
51
52
53
services:
postgres:
# image: postgres:12
build:
context: .
dockerfile: Dockerfile.postgres
restart: always
ports:
- '127.0.0.1:5435:5432'
volumes:
- ./data/postgres:/var/lib/postgresql/data
environment:
- POSTGRES_DB=demo
- POSTGRES_USER=postgres
# Please provide your own password.
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- PGBACKREST_REPO1_PATH=/tmp
# - PGBACKREST_REPO1_S3_BUCKET=demo-db
# - PGBACKREST_REPO1_S3_ENDPOINT=localhost:9002
# - PGBACKREST_REPO1_S3_KEY=${AWS_ACCESS_KEY_ID}
# - PGBACKREST_REPO1_S3_KEY_SECRET=${AWS_SECRET_ACCESS_KEY}
# - PGBACKREST_REPO1_S3_REGION=us-east-1
- PGBACKREST_REPO1_RETENTION_FULL=2
- PGBACKREST_PG1_PATH=/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d demo -U postgres" ]
interval: 5s
timeout: 60s
retries: 10
start_period: 5s
pgbackrest:
build:
context: .
dockerfile: Dockerfile.pgbackrest
environment:
- PGBACKREST_REPO1_PATH=/tmp
# - PGBACKREST_REPO1_S3_BUCKET=demo-db
# - PGBACKREST_REPO1_S3_ENDPOINT=localhost:9002
# - PGBACKREST_REPO1_S3_KEY=${AWS_ACCESS_KEY_ID}
# - PGBACKREST_REPO1_S3_KEY_SECRET=${AWS_SECRET_ACCESS_KEY}
# - PGBACKREST_REPO1_S3_REGION=us-east-1
- PGBACKREST_REPO1_RETENTION_FULL=2
- PGBACKREST_PG1_PATH=/var/lib/postgresql/data
- PGBACKREST_PG1_HOST=postgres
- PGBACKREST_PG1_PORT=5432
- PGBACKREST_PG1_USER=postgres
volumes:
- ./data/pgbackrest:/var/lib/pgbackrest
# command: ["tail", "-f", "/dev/null"]
entrypoint: ["sh", "-c", "pgbackrest --stanza=demo stanza-create && while true; do pgbackrest --stanza=demo --type=incr backup; sleep 60; done"]
depends_on:
- postgres