-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.test.yml
93 lines (88 loc) · 2.08 KB
/
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
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
version: '3.8'
services:
redis-test:
image: redis:alpine
ports:
- "6380:6379"
command: redis-server --save "" --appendonly no
volumes:
- redis-data:/data
deploy:
resources:
limits:
memory: 256M
celery-test:
build:
context: .
dockerfile: Dockerfile.test
environment:
REDIS_HOST: redis-test
REDIS_PORT: 6379
PYTHONPATH: /app
CELERY_BROKER_URL: redis://redis-test:6379
CELERY_RESULT_BACKEND: redis://redis-test:6379
depends_on:
- redis-test
volumes:
- ./app:/app/app
- ./tests:/app/tests
- ./pytest.ini:/app/pytest.ini
command: poetry run python tests/run_celery_worker.py
deploy:
resources:
limits:
memory: 512M
api:
build:
context: .
dockerfile: Dockerfile.test
environment:
REDIS_HOST: redis-test
REDIS_PORT: 6379
PYTHONPATH: /app
CELERY_BROKER_URL: redis://redis-test:6379
CELERY_RESULT_BACKEND: redis://redis-test:6379
ports:
- "8001:8000"
depends_on:
- redis-test
- celery-test
volumes:
- ./app:/app/app
- ./tests:/app/tests
- ./pytest.ini:/app/pytest.ini
command: poetry run uvicorn app.main:app --host 0.0.0.0 --port 8000
deploy:
resources:
limits:
memory: 512M
test:
build:
context: .
dockerfile: Dockerfile.test
environment:
REDIS_HOST: redis-test
REDIS_PORT: 6379
PYTHONPATH: /app
CELERY_BROKER_URL: redis://redis-test:6379
CELERY_RESULT_BACKEND: redis://redis-test:6379
API_URL: http://api:8000
TEST_PATH: ${TEST_PATH:-tests/}
PYTHONUNBUFFERED: 1
PYTEST_ADDOPTS: "--cov=app --cov-report=term-missing"
DOCKER_ENV: "true"
depends_on:
- redis-test
- api
- celery-test
volumes:
- ./app:/app/app
- ./tests:/app/tests
- ./pytest.ini:/app/pytest.ini
command: sh -c 'poetry run pytest -v ${TEST_PATH}'
deploy:
resources:
limits:
memory: 2G
volumes:
redis-data: