-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.test.yml
47 lines (43 loc) · 952 Bytes
/
docker-compose.test.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
version: '3.8'
services:
postgres_test:
image: postgres:15-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: users_test
ports:
- "5432:5432"
volumes:
- postgres_test_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
networks:
- test_network
users_service_test:
build:
context: .
dockerfile: Dockerfile.test
environment:
NODE_ENV: test
POSTGRES_HOST: postgres_test
POSTGRES_PORT: 5432
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: users_test
depends_on:
postgres_test:
condition: service_healthy
networks:
- test_network
ports:
- "5002:5002"
- "5052:5052"
networks:
test_network:
driver: bridge
volumes:
postgres_test_data: