-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
221 lines (197 loc) · 4.48 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
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
version: '3'
volumes:
pgdata: {}
statics: {}
x-django-env: &django-env
DATABASE_URL: "postgis://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres?sslmode=disable"
DJANGO_SETTINGS_MODULE: config.settings.production
DJANGO_ACCOUNT_ALLOW_REGISTRATION: "True"
USE_DOCKER: "yes"
DJANGO_BASE_SCHEMA_URL: "http://django:8000"
x-django-prod-env: &django-prod-env
<<: *django-env
DJANGO_SECRET_KEY: "${DJANGO_SECRET_KEY}"
DJANGO_SERVER_EMAIL: ""
DJANGO_ADMIN_URL: admin/
DJANGO_SECURE_SSL_REDIRECT: False
WEB_CONCURRENCY: 4
REDIS_URL: redis://redis:6379/0
DJANGO_ALLOWED_HOSTS: "localhost,django,$HOSTNAME"
x-django-dev-env: &django-dev-env
<<: *django-env
DJANGO_SETTINGS_MODULE: config.settings.local
IPYTHONDIR: "/app/.ipython"
DJANGO_ALLOWED_HOSTS: "$HOSTNAME"
DJANGO_CORS_ALLOWED_ORIGINS: "http://$HOSTNAME:3000"
x-django: &django
build:
target: django
image: metadata_catalogue_django
depends_on:
- postgres
environment:
<<: *django-env
x-django-prod: &django-prod
<<: *django
depends_on:
- redis
- postgres
profiles:
- prod
command: gunicorn config.wsgi --bind 0.0.0.0:8000 --chdir=/app
x-django-dev: &django-dev
<<: *django
image: metadata_catalogue_django:dev
build:
target: dev
profiles:
- dev
- maps
environment:
<<: *django-dev-env
volumes:
- ./config:/app/config
- ./metadata_catalogue:/app/metadata_catalogue
- ./locale:/app/locale
- ./media:/app/media
- ./shared:/app/shared
command: python manage.py runserver 0.0.0.0:8000
#command: python -m pdb -c continue manage.py runserver 0.0.0.0:8000 --nothreading --noreload
services:
django:
<<: *django-prod
environment:
<<: *django-prod-env
DJANGO_COLLECTSTATIC: 1
DJANGO_MIGRATE: 1
volumes:
- statics:/app/staticfiles
django-dev:
<<: *django-dev
tty: true
stdin_open: true
hostname: django
environment:
<<: *django-dev-env
DJANGO_MIGRATE: 1
queue:
<<: *django-prod
environment:
<<: *django-prod-env
WAIT_FOR_HTTP: http://django:8000/ht/
command: python manage.py qcluster
queue-dev:
<<: *django-dev
environment:
<<: *django-dev-env
WAIT_FOR_HTTP: http://django:8000/ht/
command: python manage.py qcluster
postgres:
image: postgis/postgis:16-3.4
volumes:
- pgdata:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- 5432:5432
# documentation
docs-dev:
image: metadata_catalogue_docs
build:
context: ./docs
dockerfile: ./Dockerfile
target: dev
volumes:
- ./docs:/book
ports:
- '3001:3000'
command: serve --hostname 0.0.0.0
profiles:
- dev
docs:
image: metadata_catalogue_docs
build:
context: ./docs
dockerfile: ./Dockerfile
target: prod
ports:
- '3000:80'
profiles:
- prod
bruno:
build:
dockerfile: ./bruno/Dockerfile
environment:
WAIT_FOR_HTTP: http://django:8000/ht/
profiles:
- test
depends_on:
- django-dev
# cache
redis:
image: redis:6
profiles:
- prod
mitm:
image: mitmproxy/mitmproxy:latest
command: mitmweb --web-host 0.0.0.0 --mode reverse:http://django-dev:8000 --modify-body /django-dev:8000/mitm:8080
profiles:
- dev
ports:
- 8080:8080
- 8081:8081
nginx:
build:
context: ./nginx
profiles:
- prod
volumes:
- statics:/statics
nginx-dev:
hostname: nginx
profiles:
- dev
build:
context: ./nginx
volumes:
- ./media:/media_files
ports:
- 8000:80
nginx-maps:
hostname: nginx
profiles:
- maps
build:
context: ./nginx
args:
- TEMPLATE_NAME=maps
volumes:
- ./media:/media_files
ports:
- 8000:80
titiler:
profiles:
- maps
image: ghcr.io/ninanor/experimental-bbox-colorscale-map-titiler:master
environment:
- TITILER_API_CACHECONTROL=no-cache
- FORWARDED_ALLOW_IPS=*
- TITILER_API_ROOT_PATH=/titiler
ports:
- "8989:8080"
maps:
profiles:
- maps
image: ghcr.io/ninanor/nina-map-explorer:main
ports:
- "3000:80"
volumes:
- ./nginx/maps.config.js:/var/www/config.js
maps-setup:
<<: *django-dev
profiles:
- maps
environment:
<<: *django-dev-env
WAIT_FOR_HTTP: http://django:8000/ht/
command: python manage.py test_map_setup