-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
77 lines (73 loc) · 2.03 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: active_record_proxy_adapters
x-postgres-common: &postgres-common
restart: always
user: postgres
healthcheck:
test: 'pg_isready -U postgres_primary_test --dbname=postgres'
interval: 10s
timeout: 5s
retries: 5
networks:
- postgres
services:
app:
build:
args:
- RUBY_VERSION=${RUBY_VERSION:-3.3.6}
- RAILS_VERSION=${RAILS_VERSION:-8.0.0}
container_name: app
image: active_record_proxy_adapters-app:${ENV_TAG:-latest}
tty: true
stdin_open: true
environment:
PGHOST: postgres_primary
PG_PRIMARY_USER: postgres_primary_test
PG_PRIMARY_PASSWORD: postgres_primary_test
PG_PRIMARY_HOST: postgres_primary
PG_PRIMARY_PORT: 5432
PG_REPLICA_USER: postgres_primary_test
PG_REPLICA_PASSWORD: postgres_primary_test
PG_REPLICA_HOST: postgres_replica
PG_REPLICA_PORT: 5432
depends_on:
- postgres_primary
- postgres_replica
networks:
- app
- postgres
volumes:
- .:/app
postgres_primary:
<<: *postgres-common
build:
context: .
dockerfile: postgres_primary.dockerfile
args:
- POSTGRES_LOGGING_COLLECTOR=${POSTGRES_LOGGING_COLLECTOR:-}
- POSTGRES_LOG_DESTINATION=${POSTGRES_LOG_DESTINATION:-}
- POSTGRES_LOG_STATEMENT=${POSTGRES_LOG_STATEMENT:-}
- REPLICA_USER=replicator
- REPLICA_PASSWORD=replicator
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres_primary_test
POSTGRES_PASSWORD: postgres_primary_test
POSTGRES_HOST_AUTH_METHOD: "scram-sha-256\nhost replication all 0.0.0.0/0 md5"
POSTGRES_INITDB_ARGS: "--auth-host=scram-sha-256"
postgres_replica:
<<: *postgres-common
build:
context: .
dockerfile: postgres_replica.dockerfile
container_name: postgres_replica
environment:
PGUSER: replicator
PGPASSWORD: replicator
PRIMARY_DATABASE_HOST: postgres_primary
depends_on:
- postgres_primary
networks:
app:
postgres:
volumes:
postgres_primary: