forked from cernopendata/opendata.cern.ch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-dev.yml
279 lines (266 loc) · 9.54 KB
/
docker-compose-dev.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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# -*- coding: utf-8 -*-
#
# This file is part of CERN Open Data Portal.
# Copyright (C) 2015, 2016, 2017, 2018, 2020, 2021 CERN.
#
# CERN Open Data Portal is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# CERN Open Data Portal is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with CERN Open Data Portal; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307, USA.
#
# In applying this license, CERN does not
# waive the privileges and immunities granted to it by virtue of its status
# as an Intergovernmental Organization or submit itself to any jurisdiction.
version: "2"
services:
# Use the following in your Python code to set a breakpoint:
# ```
# import wdb
# wdb.set_trace()
# ```
# Then open the following URL to start debugging:
# ```
# firefox http://localhost:1984
# ```
wdb:
image: kozea/wdb:3.2.5
ports:
- "1984:1984"
web:
restart: "unless-stopped"
image: cernopendata/static # Use this to make sure that COD3 Python-code image is built only once.
depends_on:
- static # Just to make sure that latest cernopendata/static -image is build before creating this container.
command: bash -c "cernopendata run -h 0.0.0.0 --reload" # In case one needs to test/work with uWSGI comment out this CMD override.
environment:
- DEBUG=True
- FLASK_ENV=development
- WDB_SOCKET_SERVER=wdb
- WDB_NO_BROWSER_AUTO_OPEN=True
- INVENIO_SQLALCHEMY_DATABASE_URI=postgresql+psycopg2://cernopendata:dbpass123@postgresql:5432/cernopendata
- INVENIO_CACHE_REDIS_HOST=redis
- INVENIO_CACHE_REDIS_URL=redis://redis:6379/0
- INVENIO_ACCOUNTS_SESSION_REDIS_URL=redis://redis:6379/1
- INVENIO_BROKER_URL=amqp://guest:guest@rabbitmq:5672/ # Celery 3
- INVENIO_CELERY_BROKER_URL=amqp://guest:guest@rabbitmq:5672/ # Celery 4
- INVENIO_CELERY_RESULT_BACKEND=redis://redis:6379/2
- INVENIO_SEARCH_ELASTIC_HOSTS=elasticsearch
- INVENIO_PIDSTORE_DATACITE_TESTMODE=False
- INVENIO_PIDSTORE_DATACITE_DOI_PREFIX=10.5072
- INVENIO_PIDSTORE_DATACITE_USERNAME=CERN.OPENDATA
- INVENIO_PIDSTORE_DATACITE_PASSWORD=CHANGE_ME
- INVENIO_PIDSTORE_LANDING_BASE_URL=http://opendata.cern.ch/record/
# - SENTRY_DSN=http://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb@sentry:9000/2
# - LOGGING_SENTRY_CELERY=True
volumes:
- ./cernopendata:/code/cernopendata
- ./scripts:/code/scripts
volumes_from:
- static
links:
- postgresql
- redis
- elasticsearch
- rabbitmq
- wdb
# - sentry
ports:
- "5000:5000"
worker:
image: cernopendata/static # Use this to make sure that COD3 Python-code image is built only once.
depends_on:
- static # Just to make sure that latest cernopendata/static -image is build before creating this container.
restart: "unless-stopped"
command: bash -c "celery -A cernopendata.celery worker --loglevel=INFO --concurrency=1"
environment:
- DEBUG=True
- WDB_SOCKET_SERVER=wdb
- WDB_NO_BROWSER_AUTO_OPEN=True
- INVENIO_SQLALCHEMY_DATABASE_URI=postgresql+psycopg2://cernopendata:dbpass123@postgresql:5432/cernopendata
- INVENIO_CACHE_REDIS_HOST=redis
- INVENIO_CACHE_REDIS_URL=redis://redis:6379/0
- INVENIO_ACCOUNTS_SESSION_REDIS_URL=redis://redis:6379/1
- INVENIO_BROKER_URL=amqp://guest:guest@rabbitmq:5672/ # Celery 3
- INVENIO_CELERY_BROKER_URL=amqp://guest:guest@rabbitmq:5672/ # Celery 4
- INVENIO_CELERY_RESULT_BACKEND=redis://redis:6379/2
- INVENIO_SEARCH_ELASTIC_HOSTS=elasticsearch
# - SENTRY_DSN=http://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb@sentry:9000/2
# - LOGGING_SENTRY_CELERY=True
volumes:
- ./cernopendata:/code/cernopendata
- ./scripts:/code/scripts
volumes_from:
- static
links:
- postgresql
- redis
- elasticsearch
- rabbitmq
- wdb
# - sentry
web-files:
restart: "unless-stopped"
image: cernopendata/static # Use this to make sure that COD3 Python-code image is built only once.
depends_on:
- static # Just to make sure that latest cernopendata/static -image is build before creating this container.
command: bash -c "cernopendata run -h 0.0.0.0" # In case one needs to test/work with uWSGI comment out this.
environment:
- DEBUG=True
- FLASK_ENV=development
- WDB_SOCKET_SERVER=wdb
- WDB_NO_BROWSER_AUTO_OPEN=True
- INVENIO_SQLALCHEMY_DATABASE_URI=postgresql+psycopg2://cernopendata:dbpass123@postgresql:5432/cernopendata
- INVENIO_CACHE_REDIS_HOST=redis
- INVENIO_CACHE_REDIS_URL=redis://redis:6379/0
- INVENIO_ACCOUNTS_SESSION_REDIS_URL=redis://redis:6379/1
- INVENIO_BROKER_URL=amqp://guest:guest@rabbitmq:5672/ # Celery 3
- INVENIO_CELERY_BROKER_URL=amqp://guest:guest@rabbitmq:5672/ # Celery 4
- INVENIO_CELERY_RESULT_BACKEND=redis://redis:6379/2
- INVENIO_SEARCH_ELASTIC_HOSTS=elasticsearch
- INVENIO_PIDSTORE_DATACITE_TESTMODE=False
- INVENIO_PIDSTORE_DATACITE_DOI_PREFIX=10.5072
- INVENIO_PIDSTORE_DATACITE_USERNAME=CERN.OPENDATA
- INVENIO_PIDSTORE_DATACITE_PASSWORD=CHANGE_ME
- INVENIO_PIDSTORE_LANDING_BASE_URL=http://opendata.cern.ch/record/
# - SENTRY_DSN=http://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb@sentry:9000/2
# - LOGGING_SENTRY_CELERY=True
volumes:
- ./cernopendata:/code/cernopendata
- ./scripts:/code/scripts
volumes_from:
- static
links:
- postgresql
- redis
- elasticsearch
- rabbitmq
- wdb
# - sentry
ports:
- "5001:5000"
postgresql:
restart: "unless-stopped"
image: postgres:12.8
environment:
- POSTGRES_USER=cernopendata
- POSTGRES_DB=cernopendata
- POSTGRES_PASSWORD=dbpass123
ports:
- "5432:5432"
redis:
restart: "unless-stopped"
image: redis
ports:
- "6379:6379"
elasticsearch:
restart: "unless-stopped"
image: elasticsearch:7.16.1
# Uncomment if DEBUG logging needs to enabled for Elasticsearch
# command: ["elasticsearch", "-Elogger.level=DEBUG"]
restart: "unless-stopped"
environment:
- bootstrap.memory_lock=true
# set to reasonable values on production
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- discovery.type=single-node
ulimits:
memlock:
soft: -1
hard: -1
mem_limit: 1g
ports:
- "9200:9200"
- "9300:9300"
rabbitmq:
restart: "unless-stopped"
image: rabbitmq
ports:
- "4369:4369"
- "5672:5672"
static:
restart: "no"
command: "echo 'Static running...'"
build:
context: .
args:
DEBUG: 1
image: cernopendata/static
volumes:
- /opt/invenio/var/instance/static
user: invenio
## SENTRY - DO NOT USE THIS ON PRODUCTION (NOT SECURE)
## Uncomment sentry prefixed services if you want to use Sentry
## for catching error logs.
## ! Remember to set / uncomment `SENTRY_DSN` and `LOGGING_SENTRY_CELERY`
## ! environment variables for cernopendata services and
## ! enable cernopendata service to reach sentry-service
## ! (e.g. by 'links' docker-compose definition).
## ! Default DSN public key: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
## ! Default DSN secret key: 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'
## Sentry UI can be reached at 'http://127.0.0.1:9000'
## Other dockerized services can reach Sentry at 'http://sentry:9000'
## (user: 'admin', password: 'admin')
## Note that cernopendata services display errors and stack traces
## on logs until sentry-service has started and is reachable
## by cernopendata services.
# sentry-base:
# restart: unless-stopped
# build: ./sentry
# image: cernopendata/sentry
# environment:
# # Run `docker-compose run sentry config generate-secret-key`
# # to get a proper the SENTRY_SECRET_KEY value.
# - SENTRY_SECRET_KEY=more_than_thirty_two_characters_long_secret_key
# - SENTRY_REDIS_HOST=redis
# # If SENTRY_DB_NAME enabled, database with this name must exists.
# # For PostgreSQL, this defaults to 'postgres'
## - SENTRY_DB_NAME=cernopendata
# - SENTRY_DB_USER=cernopendata
# - SENTRY_DB_PASSWORD=dbpass123
# - SENTRY_POSTGRES_HOST=postgresql
# - SENTRY_RABBITMQ_HOST=rabbitmq:5672
# - SENTRY_RABBITMQ_USERNAME=guest
# - SENTRY_RABBITMQ_PASSWORD=guest
#
# sentry:
# restart: unless-stopped
# extends: sentry-base
# command: init_and_run
# links:
# - redis
# - postgresql
# - rabbitmq
# ports:
# - '9000:9000'
#
# sentry-cron:
# restart: unless-stopped
# extends: sentry-base
# command: run cron
# depends_on:
# - sentry
# links:
# - redis
# - postgresql
# - rabbitmq
#
# sentry-worker:
# restart: unless-stopped
# extends: sentry-base
# command: run worker
# depends_on:
# - sentry
# links:
# - redis
# - postgresql
# - rabbitmq