Skip to content

Commit 1cb965e

Browse files
committed
Add docker compose to run different postgres instances
1 parent 70a8b95 commit 1cb965e

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

tests/docker-compose.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
services:
2+
postgres: &postgres
3+
container_name: postgres
4+
image: postgres
5+
ports:
6+
- 5532:5532
7+
environment:
8+
- PGPORT=5532
9+
- PGUSER=${POSTGRES_USERNAME}
10+
- POSTGRES_DB=${POSTGRES_DB}
11+
- POSTGRES_USER=${POSTGRES_USER}
12+
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
13+
networks:
14+
- postgres
15+
deploy:
16+
resources:
17+
limits:
18+
cpus: "${CPU_LIMIT:-2}"
19+
memory: 2048mb
20+
restart: always
21+
healthcheck:
22+
test: ["CMD-SHELL", "pg_isready"]
23+
interval: 1s
24+
timeout: 5s
25+
retries: 10
26+
27+
postgres-17:
28+
<<: *postgres
29+
image: postgres:17
30+
container_name: postgres-17
31+
32+
postgres-16:
33+
<<: *postgres
34+
image: postgres:16
35+
container_name: postgres-16
36+
37+
postgres-15:
38+
<<: *postgres
39+
image: postgres:15
40+
container_name: postgres-15
41+
42+
postgres-14:
43+
<<: *postgres
44+
image: postgres:14
45+
container_name: postgres-14
46+
47+
networks:
48+
postgres:
49+
driver: bridge
50+

0 commit comments

Comments
 (0)