-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.build
More file actions
53 lines (45 loc) · 2.45 KB
/
Copy pathDockerfile.build
File metadata and controls
53 lines (45 loc) · 2.45 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
# Set the JDK version and DSpace version
ARG JDK_VERSION=17
ARG DOCKER_REGISTRY=docker.io
# Stage 1 - Copy artifacts
FROM ${DOCKER_REGISTRY}/eclipse-temurin:${JDK_VERSION}-jre AS install
EXPOSE 8080
ENV DATA_FOLDER=/data \
DSPACE_INSTALL=/dspace \
ASSETSTORE=/dspace/assetstore \
HANDLE_DIR=/dspace/handle-server \
TRIPLESTORE_DIR=/dspace/triplestore \
DOWNLOAD_DIR=/dspace/download \
UPLOAD_DIR=/dspace/upload \
VAR_DIR=/dspace/var \
OAI_DIR=/dspace/var/oai \
TEMP_DIR=/dspace/temp \
CUSTOMER_DIR=/data/config \
CUSTOMER_CFG=conf/local-customer.cfg \
CUSTOMER_SPRING_DIR=/data/config/spring
RUN curl -L -o /tmp/certificate.crt https://www.tbs-x509.com/Comodo_AAA_Certificate_Services.crt && \
keytool -import -trustcacerts -alias comodo -file /tmp/certificate.crt -keystore $JAVA_HOME/lib/security/cacerts -storepass changeit -noprompt && \
rm /tmp/certificate.crt
ENV BASE_GROUP_GID=1000 BASE_GROUP_NAME=ubuntu
RUN if [ "$(getent group $BASE_GROUP_GID)" ]; then \
echo "Group with GID $BASE_GROUP_GID already exists, skipping group creation"; \
BASE_GROUP_NAME="$(getent group $BASE_GROUP_GID | cut -d: -f1)"; \
echo "Using existing group '$BASE_GROUP_NAME' with GID $BASE_GROUP_GID for dspace user"; \
else \
groupadd -g $BASE_GROUP_GID $BASE_GROUP_NAME; \
fi && \
groupadd -g 1001 dspace && \
useradd -m -d /home/dspace -s /bin/bash -u 1001 -g dspace -G $BASE_GROUP_NAME dspace
COPY --chown=dspace server-boot.jar /home/dspace/server-boot.jar
RUN java -Djarmode=tools -jar /home/dspace/server-boot.jar extract --destination $DSPACE_INSTALL --libraries lib
RUN install -g dspace -o dspace -d $DATA_FOLDER $ASSETSTORE $DSPACE_INSTALL $HANDLE_DIR $TRIPLESTORE_DIR $DOWNLOAD_DIR $UPLOAD_DIR $VAR_DIR $OAI_DIR $TEMP_DIR
COPY --chown=dspace ./dspace/config/ $DSPACE_INSTALL/config/
COPY --chown=dspace ./dspace/etc/conftool $DSPACE_INSTALL/config/conftool
COPY --chown=dspace --chmod=0754 ./dspace/bin/ $DSPACE_INSTALL/bin/
RUN install -g dspace -o dspace -m 664 /dev/null $DATA_FOLDER/local.cfg && \
ln -s $DATA_FOLDER/local.cfg $DSPACE_INSTALL/config/local.cfg
WORKDIR $DSPACE_INSTALL
USER dspace
ENV JAVA_TOOL_OPTIONS="-XX:MinRAMPercentage=20.0 -XX:MaxRAMPercentage=75.0 -XX:+HeapDumpOnOutOfMemoryError -XX:+UseG1GC"
ENTRYPOINT ["java", "-XX:+PrintVMOptions", "-jar", "server-boot.jar", \
"--dspace.dir=${DSPACE_INSTALL}", "--logging.config=${DSPACE_INSTALL}/config/log4j2-eks.xml"]