Skip to content

Commit a5d0809

Browse files
committed
chore: interim docker-compose for side-by-side work on pg10, pg17
1 parent 1e8f230 commit a5d0809

File tree

1 file changed

+33
-9
lines changed

1 file changed

+33
-9
lines changed

docker-compose.yml

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ networks:
77
driver: bridge
88

99
services:
10-
db:
11-
container_name: sapi-db
10+
db-pg10:
11+
container_name: sapi-db-pg10
1212
image: postgres:10
1313
command: postgres -c max_wal_size=2GB
1414
healthcheck:
@@ -28,6 +28,27 @@ services:
2828
POSTGRES_HOST_AUTH_METHOD: "trust"
2929
POSTGRES_DB: "sapi_development"
3030

31+
db-pg17:
32+
container_name: sapi-db-pg17
33+
image: postgres:17
34+
command: postgres -c max_wal_size=2GB
35+
healthcheck:
36+
test: ["CMD", "pg_isready", "-U", "postgres"]
37+
timeout: 45s
38+
interval: 10s
39+
retries: 10
40+
volumes:
41+
- ./db_init:/docker-entrypoint-initdb.d
42+
- ./db/structure.sql:/docker-entrypoint-initdb.d/sapi_schema.sql
43+
- 'pg17data:/var/lib/postgresql/data'
44+
ports:
45+
- "${SAPI_CONTAINER_DB_PORT:-5417}:5432"
46+
networks:
47+
- sapi
48+
environment:
49+
POSTGRES_HOST_AUTH_METHOD: "trust"
50+
POSTGRES_DB: "sapi_development"
51+
3152
rails:
3253
container_name: sapi-rails
3354
build:
@@ -78,14 +99,15 @@ services:
7899
environment:
79100
MAILER_ADDRESS: sapi-mailcatcher
80101
MEMCACHE_SERVERS: sapi-memcached:11211
81-
SAPI_DATABASE_HOST: sapi-db
102+
SAPI_DATABASE_HOST: sapi-db-pg17
82103
SAPI_DATABASE_USERNAME: postgres
83104
SAPI_DATABASE_PORT: 5432
84105
SAPI_SIDEKIQ_REDIS_URL: redis://sapi-redis:6379/0
85-
CAPTIVE_BREEDING_DATABASE_HOST: sapi-db
106+
CAPTIVE_BREEDING_DATABASE_HOST: sapi-db-pg17
86107
depends_on:
87108
- redis
88-
- db
109+
- db-pg10
110+
- db-pg17
89111
- mailcatcher
90112
- memcached
91113

@@ -100,7 +122,7 @@ services:
100122
stdin_open: true
101123
tty: true
102124
environment:
103-
SAPI_DATABASE_HOST: sapi-db
125+
SAPI_DATABASE_HOST: sapi-db-pg17
104126
SAPI_SIDEKIQ_REDIS_URL: redis://sapi-redis:6379/0
105127
# Defaults to blank; used by AppSignal:
106128
USER: "$USER"
@@ -128,7 +150,8 @@ services:
128150
networks:
129151
- sapi
130152
depends_on:
131-
- db
153+
- db-pg10
154+
- db-pg17
132155
- redis
133156
- mailcatcher
134157
- memcached
@@ -137,11 +160,11 @@ services:
137160
environment:
138161
MAILER_ADDRESS: sapi-mailcatcher
139162
MEMCACHE_SERVERS: sapi-memcached:11211
140-
SAPI_DATABASE_HOST: sapi-db
163+
SAPI_DATABASE_HOST: sapi-db-pg17
141164
SAPI_DATABASE_USERNAME: postgres
142165
SAPI_DATABASE_PORT: 5432
143166
SAPI_SIDEKIQ_REDIS_URL: redis://sapi-redis:6379/0
144-
CAPTIVE_BREEDING_DATABASE_HOST: sapi-db
167+
CAPTIVE_BREEDING_DATABASE_HOST: sapi-db-pg17
145168

146169
mailcatcher:
147170
container_name: sapi-mailcatcher
@@ -162,6 +185,7 @@ services:
162185

163186
volumes:
164187
pgdata:
188+
pg17data:
165189
bundler_gems:
166190
redis_data:
167191
app_tmp:

0 commit comments

Comments
 (0)