forked from research-software-directory/RSD-as-a-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
275 lines (263 loc) · 7.1 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
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
# SPDX-FileCopyrightText: 2021 - 2023 Dusan Mijatovic (dv4all)
# SPDX-FileCopyrightText: 2021 - 2023 Ewan Cahen (Netherlands eScience Center) <e.cahen@esciencecenter.nl>
# SPDX-FileCopyrightText: 2021 - 2023 Netherlands eScience Center
# SPDX-FileCopyrightText: 2021 - 2023 dv4all
# SPDX-FileCopyrightText: 2022 - 2023 Christian Meeßen (GFZ) <christian.meessen@gfz-potsdam.de>
# SPDX-FileCopyrightText: 2022 - 2023 Helmholtz Centre Potsdam - GFZ German Research Centre for Geosciences
# SPDX-FileCopyrightText: 2022 Helmholtz Centre for Environmental Research (UFZ)
# SPDX-FileCopyrightText: 2022 Matthias Rüster (GFZ) <matthias.ruester@gfz-potsdam.de>
# SPDX-FileCopyrightText: 2023 Dusan Mijatovic (Netherlands eScience Center)
# SPDX-FileCopyrightText: 2023 Dusan Mijatovic (dv4all) (dv4all)
#
# SPDX-License-Identifier: Apache-2.0
version: "3.0"
services:
database:
build: ./database
image: rsd/database:2.1.0
ports:
# enable connection from outside (development mode)
- "5432:5432"
environment:
# it uses values from .env file
- POSTGRES_DB
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_AUTHENTICATOR_PASSWORD
volumes:
# persist data in named docker volume
# to remove use: docker compose down --volumes
# to inspect use: docker volume ls
- pgdb:/var/lib/postgresql/data/
networks:
- net
backend:
build: ./backend-postgrest
image: rsd/backend-postgrest:1.12.0
expose:
- 3500
environment:
# it needs to be here to use values from .env file
- PGRST_DB_URI=postgres://rsd_authenticator:${POSTGRES_AUTHENTICATOR_PASSWORD}@${POSTGRES_DB_HOST}:${POSTGRES_DB_HOST_PORT}/${POSTGRES_DB}
- PGRST_DB_ANON_ROLE
- PGRST_DB_SCHEMA
- PGRST_SERVER_PORT
- PGRST_JWT_SECRET
depends_on:
- database
networks:
- net
auth:
build: ./authentication
image: rsd/auth:1.2.2
ports:
- 5005:5005
expose:
- 7000
environment:
# it uses values from .env file
- POSTGREST_URL
- RSD_AUTH_PROVIDERS
- RSD_ADMIN_EMAIL_LIST
- RSD_AUTH_USER_MAIL_WHITELIST
- SURFCONEXT_CLIENT_ID
- SURFCONEXT_REDIRECT
- SURFCONEXT_WELL_KNOWN_URL
- SURFCONEXT_SCOPES
- HELMHOLTZAAI_CLIENT_ID
- HELMHOLTZAAI_REDIRECT
- HELMHOLTZAAI_WELL_KNOWN_URL
- HELMHOLTZAAI_SCOPES
- HELMHOLTZAAI_USE_ALLOW_LIST
- HELMHOLTZAAI_ALLOW_LIST
- ORCID_CLIENT_ID
- ORCID_REDIRECT
- ORCID_WELL_KNOWN_URL
- ORCID_SCOPES
- AZURE_CLIENT_ID
- AZURE_REDIRECT
- AZURE_WELL_KNOWN_URL
- AZURE_SCOPES
- AZURE_ORGANISATION
- HELMHOLTZAAI_ALLOW_EXTERNAL_USERS
- AUTH_SURFCONEXT_CLIENT_SECRET
- AUTH_HELMHOLTZAAI_CLIENT_SECRET
- AUTH_ORCID_CLIENT_SECRET
- AUTH_AZURE_CLIENT_SECRET
- PGRST_JWT_SECRET
depends_on:
- database
- backend
networks:
- net
entrypoint:
[
"java",
"-agentlib:jdwp=transport=dt_socket,address=*:5005,server=y,suspend=n",
"-cp", "auth.jar",
"nl.esciencecenter.rsd.authentication.Main"
]
frontend:
build:
context: ./frontend
# dockerfile to use for build
dockerfile: Dockerfile
# update version number to correspond to frontend/package.json
image: rsd/frontend:2.0.1
environment:
# it uses values from .env file
- POSTGREST_URL
- PGRST_JWT_SECRET
- RSD_AUTH_URL
- RSD_AUTH_PROVIDERS
- MATOMO_URL
- MATOMO_ID
- SURFCONEXT_CLIENT_ID
- SURFCONEXT_REDIRECT
- SURFCONEXT_WELL_KNOWN_URL
- SURFCONEXT_SCOPES
- SURFCONEXT_RESPONSE_MODE
- HELMHOLTZAAI_CLIENT_ID
- HELMHOLTZAAI_REDIRECT
- HELMHOLTZAAI_WELL_KNOWN_URL
- HELMHOLTZAAI_SCOPES
- HELMHOLTZAAI_RESPONSE_MODE
- ORCID_CLIENT_ID
- ORCID_REDIRECT
- ORCID_WELL_KNOWN_URL
- ORCID_SCOPES
- AZURE_CLIENT_ID
- AZURE_REDIRECT
- AZURE_WELL_KNOWN_URL
- AZURE_SCOPES
- AZURE_LOGIN_PROMPT
- AZURE_DISPLAY_NAME
- AZURE_DESCRIPTION_HTML
expose:
- 3000
depends_on:
- database
- backend
- auth
# volumes:
# - ./deployment/hmz/styles:/app/public/styles
# - ./deployment/hmz/data:/app/public/data
# - ./deployment/hmz/images:/app/public/images
networks:
- net
scrapers:
build: ./scrapers
image: rsd/scrapers:1.5.0
environment:
# it uses values from .env file
- POSTGREST_URL
- PGRST_JWT_SECRET
- MAX_REQUESTS_GITHUB
- MAX_REQUESTS_GITLAB
- API_CREDENTIALS_GITHUB
- ZENODO_ACCESS_TOKEN
- MAX_REQUESTS_DOI
- CROSSREF_CONTACT_EMAIL
- ENABLE_OAIPMH_SCRAPER
- LIBRARIES_IO_ACCESS_TOKEN
depends_on:
- database
- backend
networks:
- net
swagger:
image: swaggerapi/swagger-ui:v4.15.0
expose:
- "8080"
environment:
- API_URL=${POSTGREST_URL_EXTERNAL}
- SUPPORTED_SUBMIT_METHODS=[]
networks:
- net
nginx:
build:
context: ./nginx
image: rsd/nginx:1.1.2
ports:
- "80:80"
- "443:443"
depends_on:
- database
- backend
- auth
- frontend
- swagger
networks:
- net
volumes:
- lets-encrypt:/etc/letsencrypt
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
#----------------------------------------------
# DEVELOPMENT ONLY SERVICES
#----------------------------------------------
data-generation:
build: ./data-generation
image: rsd/generation:1.3.0
environment:
# it needs to be here to use values from .env file
- PGRST_JWT_SECRET
- POSTGREST_URL
depends_on:
- backend
networks:
- net
deploy:
replicas: 0
frontend-dev:
build:
context: ./frontend
# dockerfile to use for build
dockerfile: Dockerfile.dev
args:
- DUID
- DGID
# update version number to correspond to frontend/package.json
image: rsd/frontend-dev:2.0.0
ports:
- "3000:3000"
- "9229:9229"
environment:
# it uses values from .env file
- POSTGREST_URL
- PGRST_JWT_SECRET
- RSD_AUTH_URL
- RSD_AUTH_PROVIDERS
- MATOMO_URL
- MATOMO_ID
- SURFCONEXT_CLIENT_ID
- SURFCONEXT_REDIRECT
- SURFCONEXT_WELL_KNOWN_URL
- SURFCONEXT_SCOPES
- SURFCONEXT_RESPONSE_MODE
- HELMHOLTZAAI_CLIENT_ID
- HELMHOLTZAAI_REDIRECT
- HELMHOLTZAAI_WELL_KNOWN_URL
- HELMHOLTZAAI_SCOPES
- HELMHOLTZAAI_RESPONSE_MODE
depends_on:
- database
- backend
- auth
volumes:
- ./frontend:/app
# - ./deployment/hmz/styles:/app/public/styles
# - ./deployment/hmz/data:/app/public/data
# - ./deployment/hmz/images:/app/public/images
networks:
- net
deploy:
replicas: 0
# define name for docker network
# it should have name: rsd-as-a-service_net
networks:
net:
# named volumes can be managed easier using docker compose
# volume should have name rsd-as-a-service_pgdb
volumes:
pgdb:
lets-encrypt: