Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
59 lines (58 loc) · 1.55 KB
/
Copy pathdocker-compose.yml
File metadata and controls
59 lines (58 loc) · 1.55 KB
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
59
# PGSync development environment: one source and one target PostgreSQL.
#
# docker compose up -d
# export PGSYNC_SOURCE_URL='postgres://pgsync:pgsync@localhost:5433/app'
# export PGSYNC_TARGET_URL='postgres://postgres:postgres@localhost:5434/app'
#
# Override the server version with PG_IMAGE=postgres:16 (or :17) for compatibility runs.
services:
source:
image: ${PG_IMAGE:-postgres:18}
container_name: pgsync-source
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: app
command:
- postgres
- -c
- wal_level=logical
- -c
- max_replication_slots=16
- -c
- max_wal_senders=16
- -c
- wal_sender_timeout=30s
- -c
- log_min_messages=warning
ports:
- "${PGSYNC_SOURCE_PORT:-5433}:5432"
volumes:
- ./docker/source-init:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d app"]
interval: 2s
timeout: 2s
retries: 30
shm_size: 256mb
target:
image: ${PG_IMAGE:-postgres:18}
container_name: pgsync-target
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: app
command:
- postgres
- -c
- log_min_messages=warning
ports:
- "${PGSYNC_TARGET_PORT:-5434}:5432"
volumes:
- ./docker/target-init:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d app"]
interval: 2s
timeout: 2s
retries: 30
shm_size: 256mb