-
Notifications
You must be signed in to change notification settings - Fork 17
/
docker-compose.yml
72 lines (71 loc) · 2.19 KB
/
docker-compose.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
version: '3'
services:
db:
image: postgres:11
volumes:
- $PWD/postgres_data:/var/lib/postgresql/data
env_file:
- openrepairplatform/.env
ports:
- 5433:5432
django:
# container that will use the deployment image: useful for developping in a production-ready environment
build:
context: .
dockerfile: ./deployment/django/Dockerfile
image: openrepairplatform_python
volumes:
- $PWD/openrepairplatform:/srv/app/openrepairplatform
- $PWD/openrepairplatform_media:/srv/app/media
- $PWD/openrepairplatform_static:/srv/app/static
- $PWD/deployment/django:/srv/deployment
ports:
- 8000:8000
- 5678:5678
env_file:
- openrepairplatform/.env
depends_on:
- db
working_dir: /srv/app
environment:
- DJANGO_SETTINGS_MODULE=openrepairplatform.settings.dev_docker
command:
- /bin/bash
- -c
- |
sed -i "s/{{SECRET_KEY}}/${SECRET_KEY}/" /etc/cron.d/openrepairplatform
sed -i "s/{{EMAIL_PASSWORD}}/${EMAIL_PASSWORD}/" /etc/cron.d/openrepairplatform
service cron start
chown -R openrepairplatform:openrepairplatform /srv/*
python3 -m pip install ptvsd django-debug-toolbar django_extensions
python3 manage.py migrate
python3 manage.py shell -c "from openrepairplatform.user.models import CustomUser; CustomUser.objects.create_superuser('[email protected]', 'adminpass')" || true
python3 manage.py collectstatic --noinput
python3 -m ptvsd --host 0.0.0.0 --port 5678 manage.py runserver --noreload 0.0.0.0:8000
selenium:
build:
context: .
dockerfile: ./openrepairplatform/integration_tests/selenium/Dockerfile
image: selenium_image
volumes:
- /dev/shm:/dev/shm
- ./openrepairplatform/integration_tests:/tests
- $PWD/openrepairplatform:/openrepairplatform
ports:
- 4444:4444
- 5900:5900
- 5679:5678
depends_on:
- django
environment:
- VNC_NO_PASSWORD=1
nginx:
env_file:
- openrepairplatform/.env
build:
context: .
dockerfile: ./deployment/nginx/Dockerfile
ports:
- 443:8000
depends_on:
- django