This repository has been archived by the owner on Jun 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
64 lines (52 loc) · 2.63 KB
/
Dockerfile
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
FROM tomcat:8.5-jdk8
ENV CATALINA_HOME=/usr/local/tomcat \
PATH=$CATALINA_HOME/bin:$PATH
## Dependencies
RUN GEN_DEP_PACKS="curl" && \
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \
apt-get update && \
apt-get install -y --no-install-recommends $GEN_DEP_PACKS && \
## Cleanup phase.
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
### Fedora Install
ENV JMS_BROKER_URL=tcp://activemq:61616 \
JAVA_MAX_MEM=${JAVA_MAX_MEM:-2G} \
JAVA_MIN_MEM=${JAVA_MIN_MEM:-512M} \
JAVA_OPTS='-Djava.awt.headless=true -server -Xmx${JAVA_MAX_MEM} -Xms${JAVA_MIN_MEM} -XX:+UseG1GC -XX:+UseStringDeduplication -XX:MaxGCPauseMillis=200 -XX:InitiatingHeapOccupancyPercent=70 -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true' \
FCREPO_VERSION=${FCREPO_VERSION:-5.1.0} \
FCREPO_HOME=/opt/fcrepo/data \
FCREPO_CONFIG_DIR=/opt/fcrepo/config \
# jdbc-mysql, jdbc-postgresql, file-simple
FCREPO_MODESHAPE_TYPE=jdbc-mysql \
FCREPO_AUDIT_CONTAINER=audit \
FCREPO_SPRING_CONFIG=fcrepo-config.xml \
FCREPO_NAMESPACES=namespaces \
FCREPO_DB_TYPE=mysql \
FCREPO_DB=fcrepo_db \
FCREPO_DB_USER=fedora \
FCREPO_DB_PASSWORD=fedora_pw \
FCREPO_DB_HOST=mariadb \
FCREPO_DB_PORT=3306 \
FCREPO_USER=fedoraUser \
FEDORA_USER_PASSWORD=fedoraUser_pw \
FEDORA_ADMIN=fedoraAdmin \
FEDORA_ADMIN_PASSWORD=fedoraAdmin_pw
# put all fcrepo opts in here for all configs
RUN echo 'JAVA_OPTS="$JAVA_OPTS -Dfcrepo.modeshape.configuration=classpath:/config/'$FCREPO_MODESHAPE_TYPE'-repository.json -Dfcrepo.'$FCREPO_DB_TYPE'.username='$FEDORA_ADMIN' -Dfcrepo.'$FCREPO_DB_TYPE'.password='$FEDORA_ADMIN_PASSWORD' -Dfcrepo.'$FCREPO_DB_TYPE'.host='$FCREPO_DB_HOST' -Dfcrepo.'$FCREPO_DB_TYPE'.port='$FCREPO_DB_PORT' -Dfcrepo.home='$FCREPO_HOME' -Dfcrepo.spring.configuration=file:///'$FCREPO_CONFIG_DIR'/'$FCREPO_SPRING_CONFIG' -Dfcrepo.audit.container=/'$FCREPO_AUDIT_CONTAINER'"' > $CATALINA_HOME/bin/setenv.sh && \
chmod +x $CATALINA_HOME/bin/setenv.sh
# Install Fedora 5
ARG FCREPO_VERSION
ARG FCREPO_CONFIG_DIR
ARG FCREPO_HOME
# Download FCREPO war file and copy to tomcat/webapps dir
RUN cd /tmp \
&& curl -fSL https://github.com/fcrepo4/fcrepo4/releases/download/fcrepo-$FCREPO_VERSION/fcrepo-webapp-$FCREPO_VERSION.war -o fcrepo.war \
&& cp fcrepo.war /usr/local/tomcat/webapps/fcrepo.war
# Add the /opt/fcrepo directory and contents
COPY rootfs /
# Fix permissions on fcrepo dir for tomcat
RUN chmod -Rv 644 /opt/fcrepo/config
EXPOSE 8080
WORKDIR /opt/fcrepo
CMD ["catalina.sh", "run"]