-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
200 lines (183 loc) · 6.73 KB
/
docker-compose.dev.yml
File metadata and controls
200 lines (183 loc) · 6.73 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# docker compose file for development useage
version: '3.8'
services:
frontend:
build:
context: ./
dockerfile: ./docker/nginx/nginx.Dockerfile
# Extend the existing postgis container with an accessible port for development purposes
postgis:
ports:
- 5555:5432
redis:
ports:
- 5556:6379
inspire-validator:
build:
context: ./docker/inspire-validator
ports:
- "5557:8080"
networks:
- mrmap-internal
extra_hosts:
- host.docker.internal:host-gateway
mapserver:
image: camptocamp/mapserver:7.6
hostname: "mrmap-mapserver"
volumes:
- type: bind
source: ./docker/mapserver/mapfiles
target: /etc/mapserver/mapfiles
- type: bind
source: ./docker/mapserver/shapefiles
target: /etc/mapserver/shapefiles
ports:
- "8090:80"
networks:
- mrmap-internal
pre-commit-check:
build:
context: ./backend
dockerfile: ../docker/backend/alpine.Dockerfile
args:
MRMAP_PRODUCTION: 'False'
entrypoint: /opt/mrmap/.bash_scripts/wait_db.sh
command: /bin/sh -c "/opt/mrmap/.bash_scripts/pre_commit_check.sh"
environment:
EXTERNAL_BASE_URL: "${EXTERNAL_BASE_URL:?Please configure EXTERNAL_BASE_URL in the .env file}"
DJANGO_SECRET_KEY: "${DJANGO_SECRET_KEY:?Please configure DJANGO_SECRET_KEY in the .env file}"
MRMAP_USER: "${DJANGO_ADMIN_USER:?Please configure DJANGO_ADMIN_USER in the .env file}"
MRMAP_PASSWORD: "${DJANGO_ADMIN_PASSWORD:?Please configure DJANGO_ADMIN_PASSWORD in the .env file}"
SQL_USER: "${DB_USER:?Please configure DB_PASSWORD in the .env file}"
SQL_PASSWORD: "${DB_PASSWORD:?Please configure DB_PASSWORD in the .env file}"
hostname: "mrmap-test"
volumes:
- type: bind
source: ./backend
target: /opt/mrmap
networks:
- mrmap-internal
env_file:
- ./docker/backend/.mrmap.env
depends_on:
- postgis
- redis
behave:
build:
context: ./backend
dockerfile: ../docker/backend/alpine.Dockerfile
args:
MRMAP_PRODUCTION: 'False'
shm_size: '2gb' # Fix 'Failed to decode response from marionette' (https://stackoverflow.com/questions/49734915/)
# Do not activate tty!!!!! Analog issues as for celery-worker.. it can cause auto attaching issues..
#tty: true # To support colorized log output of gherkin and other log information.
entrypoint: /opt/mrmap/.bash_scripts/wait_db.sh
command: >
/bin/sh -c "python -m coverage run --branch --source='/opt/mrmap' /opt/mrmap/manage.py behave --simple --noinput --tags=-skip --no-skipped tests/behave/features && python -m coverage xml -i -o acceptance-tests-coverage-report.xml"
hostname: "mrmap-behave"
volumes:
- type: bind
source: ./backend
target: /opt/mrmap
networks:
- mrmap-internal
env_file:
- ./docker/backend/.mrmap.env
environment:
EXTERNAL_BASE_URL: "${EXTERNAL_BASE_URL:?Please configure EXTERNAL_BASE_URL in the .env file}"
DJANGO_SECRET_KEY: "${DJANGO_SECRET_KEY:?Please configure DJANGO_SECRET_KEY in the .env file}"
MRMAP_USER: "${DJANGO_ADMIN_USER:?Please configure DJANGO_ADMIN_USER in the .env file}"
MRMAP_PASSWORD: "${DJANGO_ADMIN_PASSWORD:?Please configure DJANGO_ADMIN_PASSWORD in the .env file}"
SQL_USER: "${DB_USER:?Please configure DB_PASSWORD in the .env file}"
SQL_PASSWORD: "${DB_PASSWORD:?Please configure DB_PASSWORD in the .env file}"
DJANGO_DEBUG: 0
MRMAP_PRODUCTION: False
depends_on:
- postgis
- redis
django-tests:
build:
context: ./backend
dockerfile: ../docker/backend/alpine.Dockerfile
args:
MRMAP_PRODUCTION: 'False'
shm_size: '2gb' # Fix 'Failed to decode response from marionette' (https://stackoverflow.com/questions/49734915/)
# Do not activate tty!!!!! Analog issues as for celery-worker.. it can cause auto attaching issues..
#tty: true # To support colorized log output of gherkin and other log information.
entrypoint: /opt/mrmap/.bash_scripts/wait_db.sh
command: >
/bin/sh -c "python -m coverage run --branch --source='/opt/mrmap' ./manage.py test -v 3 /opt/mrmap/tests/ --noinput && python -m coverage xml -i -o unit-tests-coverage-report.xml"
hostname: "mrmap-django-tests"
volumes:
- type: bind
source: ./backend
target: /opt/mrmap
networks:
- mrmap-internal
env_file:
- ./docker/backend/.mrmap.env
environment:
DJANGO_DEBUG: 1
MRMAP_PRODUCTION: False
EXTERNAL_BASE_URL: "${EXTERNAL_BASE_URL:?Please configure EXTERNAL_BASE_URL in the .env file}"
DJANGO_SECRET_KEY: "${DJANGO_SECRET_KEY:?Please configure DJANGO_SECRET_KEY in the .env file}"
MRMAP_USER: "${DJANGO_ADMIN_USER:?Please configure DJANGO_ADMIN_USER in the .env file}"
MRMAP_PASSWORD: "${DJANGO_ADMIN_PASSWORD:?Please configure DJANGO_ADMIN_PASSWORD in the .env file}"
SQL_USER: "${DB_USER:?Please configure DB_PASSWORD in the .env file}"
SQL_PASSWORD: "${DB_PASSWORD:?Please configure DB_PASSWORD in the .env file}"
GUNICORN_WORKERS: ${GUNICORN_WORKERS:-4}
# explicitly override passed in environment variables.
# hierachy: image defaults --> docker client defaults from config.json -> env_file -> environment definition on compose level
#HTTP_PROXY: ""
#HTTPS_PROXY: ""
#http_proxy: ""
#https_proxy: ""
NO_PROXY: "127.0.0.1,localhost,mrmap-mapserver"
no_proxy: "127.0.0.1,localhost,mrmap-mapserver"
depends_on:
- postgis
- redis
- mapserver
backend:
build:
args:
MRMAP_PRODUCTION: "False"
container_name: backend-dev
environment:
- DJANGO_DEBUG=1
- MRMAP_PRODUCTION=False
env_file:
- docker/backend/.mrmap.env
ports:
- "0.0.0.0:8001:8001"
command: /bin/sh -c "python manage.py runserver 0.0.0.0:8001"
celery-worker:
build:
args:
MRMAP_PRODUCTION: "False"
environment:
- DJANGO_DEBUG=1
- MRMAP_PRODUCTION=False
env_file:
- ./docker/backend/.mrmap.env
command: >
/bin/sh -c "watchmedo auto-restart --directory=./ --pattern=*.py --recursive -- celery -A MrMap worker -E -l DEBUG -Q download,default,db-routines --statedb=/var/run/celery/%n-%i_worker.state"
celery-beat:
build:
args:
MRMAP_PRODUCTION: "False"
environment:
- DJANGO_DEBUG=1
- MRMAP_PRODUCTION=False
env_file:
- ./docker/backend/.mrmap.env
command: >
/bin/sh -c "watchmedo auto-restart --directory=./ --pattern=*.py --recursive -- celery -A MrMap beat --loglevel INFO --scheduler django"
flower:
ports:
- 5655:5555
networks:
sonar:
null
volumes:
sonar-db: null