-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathdocker-compose-dev.yml
More file actions
252 lines (241 loc) · 7.91 KB
/
Copy pathdocker-compose-dev.yml
File metadata and controls
252 lines (241 loc) · 7.91 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
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
services:
dev_nginx:
container_name: 'dev_nginx_proxy'
image: nginx:stable
ports:
- '8000:80'
networks:
- dataverse
depends_on:
- dev_dataverse
- dev_frontend
- dev_keycloak
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./docker-dev-volumes/nginx/logs:/var/log/nginx/
dev_frontend:
container_name: 'dev_frontend'
hostname: frontend
build:
context: ../
dockerfile: ./dev.Dockerfile
network: host
expose:
- '5173'
stdin_open: true
networks:
- dataverse
depends_on:
- dev_dataverse
volumes:
- ../:/usr/src/app
- ../dev-env/vite.config.ts:/usr/src/app/vite.config.ts
- /usr/src/app/dev-env
- /usr/src/app/node_modules
dev_dataverse:
container_name: 'dev_dataverse'
hostname: dataverse
image: ${REGISTRY}/gdcc/dataverse:${DATAVERSE_IMAGE_TAG}
restart: on-failure
user: payara
environment:
dataverse_files_storage__driver__id: s3
DATAVERSE_DB_HOST: postgres
DATAVERSE_DB_PASSWORD: secret
DATAVERSE_DB_USER: ${DATAVERSE_DB_USER}
DATAVERSE_FEATURE_API_BEARER_AUTH: 1
DATAVERSE_FEATURE_API_BEARER_AUTH_PROVIDE_MISSING_CLAIMS: 1
DATAVERSE_FEATURE_API_BEARER_AUTH_USE_BUILTIN_USER_ON_ID_MATCH: 1
DATAVERSE_AUTH_OIDC_ENABLED: 1
DATAVERSE_AUTH_OIDC_HIDDEN_JSF: 1
DATAVERSE_AUTH_OIDC_CLIENT_ID: test
DATAVERSE_AUTH_OIDC_CLIENT_SECRET: 94XHrfNRwXsjqTqApRrwWmhDLDHpIYV8
DATAVERSE_AUTH_OIDC_AUTH_SERVER_URL: http://keycloak.mydomain.com:9080/realms/test
JVM_ARGS: -Ddataverse.pid.providers=fake
-Ddataverse.pid.default-provider=fake
-Ddataverse.pid.fake.type=FAKE
-Ddataverse.pid.fake.label=FakeDOIProvider
-Ddataverse.pid.fake.authority=10.5072
-Ddataverse.pid.fake.shoulder=FK2/
-Ddataverse.files.s3.access-key=${S3_ACCESS_KEY}
-Ddataverse.files.s3.label=s3
-Ddataverse.files.s3.secret-key=${S3_SECRET_KEY}
-Ddataverse.files.storage-driver-id=s3
-Ddataverse.files.s3.type=s3
-Ddataverse.files.s3.bucket-name=beta-dataverse-direct
-Ddataverse.files.s3.upload-redirect=true
-Ddataverse.files.s3.download-redirect=true
-Ddataverse.files.s3.ingestsizelimit=50000000
-Ddataverse.files.s3.url-expiration-minutes=60
-Ddataverse.files.s3.connection-pool-size=2048
-Ddataverse.files.s3.custom-endpoint-region=us-east-1
-Ddataverse.files.s3.custom-endpoint-url=https://s3.us-east-1.amazonaws.com
# We publish the port on the host machine instead of just exposing it within the network, so that the browser can access the URLs of images generated by Dataverse (http://localhost:8080...).
# This is necessary because the dev_nginx proxy is placed on top of the Dataverse service, making those URLs unreachable unless this port is exposed.
# This workaround is only necessary and intended for the local dev environment and will not be used in the remote environment, where we use a production DNS.
ports:
- '8080:8080'
networks:
- dataverse
depends_on:
- dev_postgres
- dev_solr
volumes:
- ./docker-dev-volumes/app/data:/dv
- ./docker-dev-volumes/app/secrets:/secrets
tmpfs:
- /dumps:mode=770,size=2052M,uid=1000,gid=1000
- /tmp:mode=770,size=2052M,uid=1000,gid=1000
mem_limit: 2147483648 # 2 GiB
mem_reservation: 1024m
privileged: false
dv_initializer:
container_name: 'dv_initializer'
image: gdcc/configbaker:unstable
restart: 'no'
command:
- sh
- -c
- 'fix-fs-perms.sh dv'
volumes:
- ./docker-dev-volumes/app/data:/dv
dev_dataverse_bootstrap:
container_name: 'dev_dataverse_bootstrap'
image: gdcc/configbaker:unstable
restart: 'no'
environment:
- TIMEOUT=${DATAVERSE_BOOTSTRAP_TIMEOUT}
command:
- bootstrap.sh
- dev
networks:
- dataverse
dev_postgres:
container_name: 'dev_postgres'
hostname: postgres
image: postgres:${POSTGRES_VERSION}
restart: on-failure
environment:
- POSTGRES_USER=${DATAVERSE_DB_USER}
- POSTGRES_PASSWORD=secret
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${DATAVERSE_DB_USER}" ]
interval: 10s
timeout: 5s
retries: 10
expose:
- '5432'
networks:
- dataverse
volumes:
- ./docker-dev-volumes/postgresql/data:/var/lib/postgresql/data
dev_solr_initializer:
container_name: 'dev_solr_initializer'
image: gdcc/configbaker:unstable
restart: 'no'
command:
- sh
- -c
- 'fix-fs-perms.sh solr && cp -a /template/* /solr-template'
volumes:
- ./docker-dev-volumes/solr/data:/var/solr
- ./docker-dev-volumes/solr/conf:/solr-template
dev_solr:
container_name: 'dev_solr'
hostname: 'solr'
image: solr:${SOLR_VERSION}
depends_on:
dev_solr_initializer:
condition: service_completed_successfully
restart: on-failure
expose:
- '8983'
networks:
- dataverse
command:
- 'solr-precreate'
- 'collection1'
- '/template'
volumes:
- ./docker-dev-volumes/solr/data:/var/solr
- ./docker-dev-volumes/solr/conf:/template
dev_smtp:
container_name: 'dev_smtp'
hostname: 'smtp'
image: maildev/maildev:2.0.5
restart: on-failure
expose:
- '25' # smtp server
ports:
- '1080:1080' # web ui
environment:
- MAILDEV_SMTP_PORT=25
- MAILDEV_MAIL_DIRECTORY=/mail
networks:
- dataverse
#volumes:
# - ./docker-dev-volumes/smtp/data:/mail
tmpfs:
- /mail:mode=770,size=128M,uid=1000,gid=1000
dev_keycloak:
container_name: "dev_keycloak"
depends_on:
dev_postgres:
condition: service_healthy
build:
context: ./keycloak
dockerfile: Dockerfile
image: gdcc/keycloak
hostname: keycloak
environment:
- KC_HTTP_ENABLED=true
- KC_HOSTNAME_STRICT=false
- KC_HTTP_PORT=9080
- KC_HOSTNAME_BACKCHANNEL_DYNAMIC=true
- KC_HOSTNAME=http://localhost:8000
- KC_HOSTNAME_ADMIN_URL=http://localhost:8000
- KEYCLOAK_ADMIN=kcadmin
- KEYCLOAK_ADMIN_PASSWORD=kcpassword
- KEYCLOAK_LOGLEVEL=DEBUG
- KC_DB=postgres
- KC_DB_URL=jdbc:postgresql://postgres:5432/dataverse
- KC_DB_USERNAME=${DATAVERSE_DB_USER}
- KC_DB_PASSWORD=secret
- DATAVERSE_DB_HOST=postgres
- DATAVERSE_DB_PORT=5432
- DATAVERSE_DB_USER=${DATAVERSE_DB_USER}
- DATAVERSE_DB_PASSWORD=secret
- DATAVERSE_BASE_URL=http://localhost:8000
networks:
dataverse:
aliases:
- keycloak.mydomain.com
command: start-dev --import-realm
expose:
- '9000'
- '9080'
# The following volume is commented out. To use it, uncomment the line and make sure to build the custom theme first.:
# 1. Run `npm run build-keycloak-theme` to build the custom theme, you need to have maven installed for this step.
# This will create a jar file in the `dist_keycloak` directory.
# The jar file is named `dv-spa-kc-theme.jar`.
# 2. Uncomment the volumes line below to mount the jar file into the Keycloak container.
# 3. Restart the dev dockerized environment.
# 4. The custom theme will be available in the test realm in Keycloak. Realm settings => Themes => Login Theme => select dataverse-spa
# volumes:
# - ../dist_keycloak/dv-spa-kc-theme.jar:/opt/keycloak/providers/dv-spa-kc-theme.jar
dev_keycloak_initializer:
image: alpine:latest
container_name: "dev_keycloak_initializer"
depends_on:
- dev_keycloak
environment:
- KEYCLOAK_ADMIN=kcadmin
- KEYCLOAK_ADMIN_PASSWORD=kcpassword
volumes:
- ./keycloak/setup-spi.sh:/usr/local/bin/setup-spi.sh
command: [ "/bin/sh", "-c", "apk add --no-cache curl jq && /usr/local/bin/setup-spi.sh" ]
networks:
- dataverse
networks:
dataverse:
driver: bridge