-
Notifications
You must be signed in to change notification settings - Fork 12
/
docker-compose.test.yml
47 lines (44 loc) · 1.49 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
# Service definitions for e2e testing.
# Run the tests with
# ```
# docker-compose --file docker-compose.yml --file docker-compose.test.yml up --build --exit-code-from tests db web tests
# ```
---
version: '2.1'
services:
web:
build:
context: .
dockerfile: .contrib/docker/Dockerfile.web
# Rebuilding web container to run django app server for cypress e2e tests
command: bash -c "python manage.py collectstatic --no-input && python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
environment:
# Use a test database.
# This should make it a bit less likely for someone to run integration
# tests on production tables and accidentally drop all data.
DATABASE_URL: mysql://root:password@db/test_poradnia
TEST: 1
# Console email backend needed for cypress user authentication
DJANGO_EMAIL_BACKEND: django.core.mail.backends.console.EmailBackend
DJANGO_DEFAULT_FROM_EMAIL: "poradnia_dev <[email protected]>"
DJANGO_RICH_TEXT_ENABLED: "False"
ACCOUNT_EMAIL_VERIFICATION: "optional"
networks:
- poradnia-app-network
tests:
depends_on:
- db
- web
build:
context: ./tests/
dockerfile: Dockerfile
volumes:
- ./tests:/e2e
- /e2e/node_modules # un-shadow node_modules
networks:
- poradnia-app-network
working_dir: /e2e
command: sh -c "wait-for-it web:8000 -t 60 && npx cypress run"
networks:
poradnia-app-network:
driver: bridge