-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-pytest.yml
68 lines (63 loc) · 1.33 KB
/
docker-compose-pytest.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
version: '3.8'
services:
database:
image: postgres:15.1-alpine
container_name: database
expose:
- "5432"
ports:
- "5432:5432"
volumes:
- ylab_pgdata_pytest:/var/lib/postgresql/data/
env_file:
- .env_test
networks:
- ylab_network_pytest
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-U", "${POSTGRES_USER}", "-d", "${POSTGRES_DB}"]
interval: 10s
timeout: 30s
retries: 5
redis:
image: redis:latest
container_name: redis
networks:
- ylab_network_pytest
volumes:
- ylab_redis_data_pytest:/data
expose:
- "6379"
ports:
- "6379:6379"
env_file:
- .env_test
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
interval: 1s
timeout: 3s
retries: 5
backend:
build:
context: .
dockerfile: Dockerfile
container_name: backend
networks:
- ylab_network_pytest
depends_on:
database:
condition: service_healthy
redis:
condition: service_healthy
ports:
- "8000:80"
env_file:
- .env_test
command: sh -c "pytest -v"
networks:
ylab_network_pytest:
name: ylab_network_pytest
volumes:
ylab_pgdata_pytest:
name: ylab_pgdata_pytest
ylab_redis_data_pytest:
name: ylab_redis_data_pytest