-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
58 lines (56 loc) · 1.71 KB
/
docker-compose.yaml
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
54
55
56
57
58
services:
postgres:
image: postgres:${POSTGRES_VERSION:-17}
container_name: postgres
restart: always
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?error}
volumes:
- ./postgres_data:/var/lib/postgresql/data
ports:
- "127.0.0.1:${POSTGRES_PORT:-5432}:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 3
postgrest:
image: postgrest/postgrest:${PGRST_VERSION:-v12.2.0}
container_name: postgrest
restart: always
environment:
PGRST_DB_URI: postgres://${PGRST_USER}:${PGRST_PASSWORD}@postgres:${POSTGRES_PORT}/${POSTGRES_DB}
PGRST_DB_SCHEMA: ${PGRST_DB_SCHEMA}
PGRST_DB_ANON_ROLE: ${PGRST_DB_ANON_ROLE}
PGRST_JWT_SECRET: ${PGRST_JWT_SECRET:?error}
PGRST_DB_POOL: ${PGRST_DB_POOL}
PGRST_ADMIN_SERVER_PORT: "3001"
ports:
- "${PGRST_PORT:-3000}:3000"
- "3001:3001"
depends_on:
postgres:
condition: service_healthy
pgbackups:
image: prodrigestivill/postgres-backup-local:${POSTGRES_VERSION:-17}
container_name: pgbackups
restart: always
environment:
POSTGRES_HOST: postgres
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?error}
POSTGRES_PORT: ${POSTGRES_PORT}
POSTGRES_EXTRA_OPTS: -Z6
SCHEDULE: "@daily"
BACKUP_KEEP_DAYS: 10
BACKUP_KEEP_WEEKS: 10
BACKUP_KEEP_MONTHS: 50
HEALTHCHECK_PORT: 8080
volumes:
- ./postgres_backups:/backups
depends_on:
postgres:
condition: service_healthy