forked from DSpace/dspace-angular
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose-rest.yml
More file actions
157 lines (156 loc) · 7.47 KB
/
Copy pathdocker-compose-rest.yml
File metadata and controls
157 lines (156 loc) · 7.47 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
#
# The contents of this file are subject to the license and copyright
# detailed in the LICENSE and NOTICE files at the root of the source
# tree and available online at
#
# http://www.dspace.org/license/
#
# Docker Compose for running the DSpace backend for testing/development
# This is based heavily on the docker-compose.yml that is available in the DSpace/DSpace
# (Backend) at:
# https://github.com/DSpace/DSpace/blob/main/docker-compose.yml
networks:
dspacenet:
# Due to the following specification, THIS FILE (docker-compose-rest.yml) must be last (if using several YMLs),
# since it specifies network in more detail. If it is not last, there is "root must be a mapping" error.
ipam:
config:
# Define a custom subnet for our DSpace network, so that we can easily trust requests from host to container.
# If you customize this value, be sure to customize the 'proxies.trusted.ipranges' env variable below.
- subnet: 172.2.${TRUST_IP_RANGE}.0/24
services:
# DSpace (backend) webapp container
dspace:
restart: unless-stopped
container_name: dspace${DSPACE_PORT}
environment:
JAVA_OPTS: ${JAVA_OPTS:--Xmx4g}
TZ: ${TIMEZONE:-Europe/Bratislava}
# Below syntax may look odd, but it is how to override dspace.cfg settings via env variables.
# See https://github.com/DSpace/DSpace/blob/main/dspace/config/config-definition.xml
# __P__ => "." (e.g. dspace__P__dir => dspace.dir)
# __D__ => "-" (e.g. google__D__metadata => google-metadata)
# dspace.dir, dspace.server.url, dspace.ui.url and dspace.name
dspace__P__dir: /dspace
dspace__P__server__P__url: ${REST_URL:-http://127.0.0.1:8080/server}
dspace__P__ui__P__url: ${UI_URL:-http://127.0.0.1:4000}
# db.url: Ensure we are using the 'dspacedb' image for our database
db__P__url: 'jdbc:postgresql://pgcit17.vsb.cz:${PG_PORT}/dspace'
# solr.server: Ensure we are using the 'dspacesolr' image for Solr
solr__P__server: http://dspacesolr:${SOLR_PORT}/solr
# proxies.trusted.ipranges: This setting is required for a REST API running in Docker to trust requests
# from the host machine. This IP range MUST correspond to the 'dspacenet' subnet defined above.
proxies__P__trusted__P__ipranges: '172.2.${TRUST_IP_RANGE}'
#S3 config
assetstore__P__index__P__primary: ${S3_STORAGE:-0}
assetstore__P__s3__P__enabled: ${S3_ENABLED:-false}
assetstore__P__s3__P__useRelativePath: ${S3_RELATIVE_PATH:-false}
assetstore__P__s3__P__bucketName: ${S3_BUCKET:-bucket-for-dspace}
assetstore__P__s3__P__subfolder: ${S3_SUBFOLDER:-}
assetstore__P__s3__P__awsAccessKey: ${S3_ACCESS:-}
assetstore__P__s3__P__awsSecretKey: ${S3_SECRET:-}
assetstore__P__s3__P__awsRegionName: ${S3_REGION_NAME:-}
assetstore__P__s3__P__pathStyleAccessEnabled: ${S3_PATH_STYLE_ACCESS:-false}
assetstore__P__s3__P__endpoint: ${S3_ENDPOINT:-}
# CNRI Handle prefix
handle__P__prefix: ${HANDLE_PREFIX:-10084}
image: ${DSPACE_REST_IMAGE:-dataquest/dspace:dtq-dev-7.5}
networks:
- dspacenet
ports:
# BE server port
- published: ${DSPACE_DOCKER_REST_PORT}
target: 8080
host_ip: ${HOST_IP:-127.0.0.1}
# original debug port
- published: ${DSPACE_DEBUG_PORT}
target: 8000
host_ip: ${HOST_IP:-127.0.0.1}
# handle binary port as per https://www.handle.net/hnr_support.html (5th paragraph)
- published: ${DSPACE_HANDLE_PORT}
target: 2641
host_ip: 127.0.0.1
# handle http port as per https://www.handle.net/hnr_support.html (5th paragraph)
- published: ${DSPACE_HANDLE_PORT_HTTP}
target: 8010
host_ip: 127.0.0.1
stdin_open: true
tty: true
volumes:
- dspace_logs:/dspace/log
- assetstore:/dspace/assetstore
- handle_server:/dspace/handle-server
# - ./local.cfg:/dspace/config/local.cfg
# Ensure that the database is ready BEFORE starting tomcat
# 1. While a TCP connection to dspacedb port 5432 is not available, continue to sleep
# 2. Then, run database migration to init database tables
# 3. Use custom_run script, to enable debugging under certain conditions
# 4. Start the Handle server!!!! (please make sure you DO actually want it, otherwise remove last line)
entrypoint:
- /bin/bash
- '-c'
# When customizing the namespace, add the following command to the entrypoint command below (after `while ...`):
# `pushd ../webapps && (unlink server || true) && (ln -s /dspace/webapps/server/ 'repository#server' || true) &&
# popd`
# The `(... || true)` condition is necessary to ensure the `popd` command runs at the end.
# It used to fail when the `server` folder did not exist in `/webapps`.
# This will create a symlink from the webapps directory to the server directory with the custom namespace
# (e.g. /dspace/webapps/server -> /dspace/webapps/repository#server)
# removed from `while`, because: not needed here
# There is problem in the database when `database migrate` is called here and then from the
# `deploy action`
# /dspace/bin/dspace database migrate force
# /dspace/bin/start-handle-server
- |
apt update && apt install -y ldap-utils && apt clean && rm -rf /var/lib/apt/lists/*
mkdir -p /etc/ldap
grep -qxF "TLS_CACERT /etc/ssl/certs/ca-certificates.crt" /etc/ldap/ldap.conf || echo "TLS_CACERT /etc/ssl/certs/ca-certificates.crt" >> /etc/ldap/ldap.conf
export LDAPTLS_CACERT=/etc/ssl/certs/ca-certificates.crt
./custom_run.sh
# DSpace Solr container
dspacesolr:
environment:
TZ: ${TIMEZONE:-Europe/Bratislava}
restart: unless-stopped
container_name: dspacesolr${DSPACE_PORT}
image: ${DSPACE_SOLR_IMAGE:-dataquest/dspace-solr:dspace-7_x}
networks:
dspacenet:
ports:
- published: ${SOLR_PORT}
target: ${SOLR_PORT}
host_ip: ${HOST_IP:-127.0.0.1}
stdin_open: true
tty: true
working_dir: /var/solr/data
volumes:
# Keep Solr data directory between reboots
- solr_data:/var/solr/data
- solr_logs:/var/solr/logs
# Initialize all DSpace Solr cores using the mounted local configsets (see above), then start Solr
# * First, run precreate-core to create the core (if it doesn't yet exist). If exists already, this is a no-op
# * Second, copy configsets to this core:
# Updates to Solr configs require the container to be rebuilt/restarted:
# `docker-compose -p d7 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml up -d --build dspacesolr`
entrypoint:
- /bin/bash
- '-c'
- |
init-var-solr
precreate-core authority /opt/solr/server/solr/configsets/authority
cp -r /opt/solr/server/solr/configsets/authority/* authority
precreate-core oai /opt/solr/server/solr/configsets/oai
cp -r /opt/solr/server/solr/configsets/oai/* oai
precreate-core search /opt/solr/server/solr/configsets/search
cp -r /opt/solr/server/solr/configsets/search/* search
precreate-core statistics /opt/solr/server/solr/configsets/statistics
cp -r /opt/solr/server/solr/configsets/statistics/* statistics
exec solr -p ${SOLR_PORT} -f -m 4g
volumes:
# Commented out because there are a lot of files in the assetstore
assetstore:
solr_data:
# Special volume used to share Solr configs from 'dspace' to 'dspacesolr' container (see above)
dspace_logs:
solr_logs:
handle_server: