-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
96 lines (83 loc) · 3.25 KB
/
Dockerfile
File metadata and controls
96 lines (83 loc) · 3.25 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
FROM ubuntu:24.04
# Build args (for config.dct) :
ARG PRIMARY_SERVER
ARG DUAL_STACK_SERVER
ARG IP_ADDRESS
ARG BIND_IP
ARG TCP_UDP_PORT
ARG HTTP_PORT
ARG LOG_ACCESS
ARG LOG_ROTATION_FREQUENCY_SHORT
ARG SITE_VERSION_SERIAL_NUMBER
ARG SERVER_DESCRIPTION
ARG ORG_NAME
ARG ORG_CONTACT_PERSON
ARG ORG_CONTACT_PHONE
ARG ORG_CONTACT_EMAIL
ARG DISABLE_UDP
ARG ENCRYPT_SERVER_KEY
ARG ENCRYPT_ADMIN_KEY
ARG HANDLE_PREFIX
ARG LOG_ROTATION_FREQUENCY_LONG
ARG DSPACE_SERVER_URL
ARG JAVA_OPTS
# Basic ENVs :
ENV DEBIAN_FRONTEND="noninteractive"
ENV LC_ALL="en_US.UTF-8"
ENV LANG="en_US.UTF-8"
# Configurable settings in config.dct :
ENV BIND_IP=${BIND_IP}
ENV HTTP_PORT=${HTTP_PORT}
ENV LOG_ACCESS=${LOG_ACCESS}
ENV TCP_UDP_PORT=${TCP_UDP_PORT}
ENV HANDLE_PREFIX=${HANDLE_PREFIX}
ENV LOG_ROTATION_FREQUENCY_LONG=${LOG_ROTATION_FREQUENCY_LONG}
ENV DSPACE_SERVER_URL=${DSPACE_SERVER_URL}
ENV JAVA_OPTS=${JAVA_OPTS}
# Install basic packages :
RUN apt-get update -y && \
apt-get upgrade -y && \
apt-get install -y wget nano curl unzip tzdata locales ca-certificates && \
apt-get upgrade ca-certificates -y && \
apt-get install -y iputils-ping iproute2 net-tools && \
ln -fs /usr/share/zoneinfo/America/Chicago /etc/localtime && \
locale-gen en_US.UTF-8 && \
update-locale LANG=en_US.UTF-8
# Install handle-server :
RUN apt-get install -y default-jdk && \
mkdir /hs /hs/svr_1 /hs/svr_1/logs && \
rm -f /hs/handle-9.3.1/bin/hdl
COPY handle-9.3.1 /hs/handle-9.3.1
COPY dspace-remote-handle-resolver-1.0.jar /hs/handle-9.3.1/lib/
COPY hdl /hs/handle-9.3.1/bin/
# Generate hdl setup server answer file :
RUN touch /hs/hdl-setup-server-answers.txt && \
echo ${PRIMARY_SERVER} >> /hs/hdl-setup-server-answers.txt && \
echo ${DUAL_STACK_SERVER} >> /hs/hdl-setup-server-answers.txt && \
echo ${IP_ADDRESS} >> /hs/hdl-setup-server-answers.txt && \
echo ${BIND_IP} >> /hs/hdl-setup-server-answers.txt && \
echo ${TCP_UDP_PORT} >> /hs/hdl-setup-server-answers.txt && \
echo ${HTTP_PORT} >> /hs/hdl-setup-server-answers.txt && \
echo ${LOG_ACCESS} >> /hs/hdl-setup-server-answers.txt && \
echo ${LOG_ROTATION_FREQUENCY_SHORT} >> /hs/hdl-setup-server-answers.txt && \
echo ${SITE_VERSION_SERIAL_NUMBER} >> /hs/hdl-setup-server-answers.txt && \
echo ${SERVER_DESCRIPTION} >> /hs/hdl-setup-server-answers.txt && \
echo ${ORG_NAME} >> /hs/hdl-setup-server-answers.txt && \
echo ${ORG_CONTACT_PERSON} >> /hs/hdl-setup-server-answers.txt && \
echo ${ORG_CONTACT_PHONE} >> /hs/hdl-setup-server-answers.txt && \
echo ${ORG_CONTACT_EMAIL} >> /hs/hdl-setup-server-answers.txt && \
echo ${DISABLE_UDP} >> /hs/hdl-setup-server-answers.txt && \
echo ${ENCRYPT_SERVER_KEY} >> /hs/hdl-setup-server-answers.txt && \
echo ${ENCRYPT_ADMIN_KEY} >> /hs/hdl-setup-server-answers.txt && \
cat /hs/hdl-setup-server-answers.txt
# Configure handle server configs :
RUN rm -rf /hs/svr_1/* && \
/hs/handle-9.3.1/bin/hdl-setup-server /hs/svr_1 < /hs/hdl-setup-server-answers.txt && \
rm -f /hs/svr_1/config.dct
COPY config.dct /hs/svr_1/
COPY log4j-handle-plugin.properties /hs/svr_1/
COPY handle-dspace-plugin.cfg /hs/svr_1/
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
WORKDIR /hs/svr_1
ENTRYPOINT ["entrypoint.sh"]