-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.test.yml
138 lines (127 loc) · 3.8 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
services:
db:
image: postgres:10-alpine
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- test-dbdata:/var/lib/postgresql/data/pgdata
networks:
- test-net
# ports:
# # postgres accessible on the host at 5433 for debugging
# - "5433:5432"
sut:
image: laxy:dev
build:
context: .
dockerfile: ./docker/laxy/Dockerfile
environment:
- LAXY_DEBUG=yes
- LAXY_SSL=no
- LAXY_DATABASE_URL=postgres://postgres:postgres@db:5432/postgres
- LAXY_BROKER_URL=amqp://guest@rabbitmq
- LAXY_ADMIN_EMAIL=admin@example.com
- LAXY_ADMIN_USERNAME=admin
- LAXY_ADMIN_PASSWORD=adminpass
- LAXY_SECRET_KEY=_do_please_change_this_in_production_
- LAXY_USE_SSL=no
- LAXY_JOB_TEMPLATE_PATHS=/app/laxy_backend/tests/test_data/templates
# For pytest
- DJANGO_SETTINGS_MODULE=laxy.settings
# volumes:
# - .:/app
# Django app is publicly accessible without reverse proxy
# ports:
# - "8001:8001"
networks:
- test-net
depends_on:
- db
# command: python3 ./manage.py test
command: bash -c "pip install -U -r requirements-dev.txt && pytest"
test-dev:
image: laxy:test
build:
context: .
dockerfile: ./docker/laxy-test/Dockerfile
environment:
- LAXY_DEBUG=yes
- LAXY_SSL=no
- LAXY_DATABASE_URL=postgres://postgres:postgres@db:5432/postgres
- LAXY_BROKER_URL=amqp://guest@rabbitmq
- LAXY_ADMIN_EMAIL=admin@example.com
- LAXY_ADMIN_USERNAME=admin
- LAXY_ADMIN_PASSWORD=adminpass
- LAXY_SECRET_KEY=_do_please_change_this_in_production_
- LAXY_USE_SSL=no
- LAXY_JOB_TEMPLATE_PATHS=/app/laxy_backend/tests/test_data/templates
# For pytest
- DJANGO_SETTINGS_MODULE=laxy.settings
volumes:
- .:/app
ports:
# Debugger port
- "21001:21001"
networks:
- test-net
depends_on:
- db
# command: python3 ./manage.py test
# There are various ways we can run pytest, eg if we want to run just a subset of tests,
# or drop into the PDB debugger when an uncaught exception is raised
command: pytest -vvv --showlocals --tb=auto
# command: pytest -ra
# command: pytest -vvv --pdb
# command: pytest -vvv --pdb laxy_backend/tests/test_tasks.py
# command: pytest -vvv --showlocals --tb=auto laxy_backend/tests/test_views.py
# command: pytest -vvv --pdb laxy_backend/tests/test_views.py
# command: pytest -vvv laxy_backend/tests/test_models.py
# command: pytest -vvv laxy_backend/tests/test_util.py
# Not working for me
# command: python -m ptvsd --host 0.0.0.0 --port 21001 --wait -m pytest -vvv
##
# Disabled services not required for simple local dev, overridden from base docker-compose.yml
##
# For simple local development, we run in Django debug mode (LAXY_DEBUG=yes) with CELERY_ALWAYS_EAGER=True
# so that celery tasks run non-async in the Django process. We don't need the celery daemon in this case.
queue-high:
image: alpine
entrypoint:
- /bin/echo
command: "Service disabled"
restart: "no"
queue-low:
image: alpine
entrypoint:
- /bin/echo
command: "Service disabled"
restart: "no"
celery-beat:
image: alpine
entrypoint:
- /bin/echo
command: "Service disabled"
restart: "no"
# We don't need flower if we aren't using celeryd
flower:
image: alpine
entrypoint:
- /bin/echo
command: "Service disabled"
restart: "no"
nginx:
image: alpine
entrypoint:
- /bin/echo
command: "Service disabled"
restart: "no"
ports:
# dev
- "9999:80"
volumes:
test-dbdata:
networks:
test-net: