-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
117 lines (111 loc) · 2.64 KB
/
docker-compose.test.yml
File metadata and controls
117 lines (111 loc) · 2.64 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
services:
postgres-test:
image: postgres:17.5-alpine3.22
container_name: postgres_test
restart: unless-stopped
env_file:
- .env.test
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
expose:
- "${POSTGRES_PORT}"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}" ]
interval: 5s
timeout: 3s
retries: 5
networks:
- taskflow_net_test
tmpfs:
- /var/lib/postgresql/data
redis-test:
image: redis:8.0.3-alpine
container_name: redis_test
restart: unless-stopped
env_file:
- .env.test
command: [ "redis-server", "--save", "" ]
expose:
- "${REDIS_PORT}"
networks:
- taskflow_net_test
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 10s
timeout: 5s
retries: 3
start_period: 5s
tmpfs:
- /data
minio-test:
build: ./minio
container_name: minio_test
expose:
- "${MINIO_STORAGE_PORT}"
- "${MINIO_WEB_PORT}"
tmpfs:
- /data
env_file:
- .env.test
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:${MINIO_WEB_PORT}/minio/health/live" ]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
networks:
- taskflow_net_test
minio-init-test:
image: minio/mc:latest
depends_on:
minio-test:
condition: service_healthy
volumes:
- ./init-minio.sh:/init-minio.sh:ro
env_file:
- .env.test
entrypoint: [ "/bin/sh", "/init-minio.sh" ]
networks:
- taskflow_net_test
migrate-test:
build: .
container_name: taskflow_migrate_test
restart: "no"
depends_on:
postgres-test:
condition: service_healthy
env_file:
- .env.test
environment:
MIGRATION_INSIDE_DOCKER: 1
command: alembic upgrade head
networks:
- taskflow_net_test
web-test:
build:
context: .
dockerfile: Dockerfile.test
container_name: taskflow_web_test
depends_on:
postgres-test:
condition: service_healthy
redis-test:
condition: service_healthy
minio-test:
condition: service_healthy
env_file:
- .env.test # монтируем папку для отчёта
environment:
MIGRATION_INSIDE_DOCKER: 1
volumes:
- ./htmlcov:/fast_api/htmlcov
- ./src:/fast_api/src
networks:
- taskflow_net_test
command: ["sh", "-c", "alembic upgrade head && pytest -s"]
networks:
taskflow_net_test:
name: taskflow_net_test
driver: bridge