This repository has been archived by the owner on May 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
70 lines (54 loc) · 2.4 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
65
66
67
68
69
70
FROM tomcat:8-jdk8
MAINTAINER Teaching and Learning <[email protected]>
RUN apt-get update \
&& apt-get install -y vim maven git
ENV JAVA_HOME=/usr/local/openjdk-8/jre
WORKDIR /tmp
# Build esbUtils, a dependency of the CCM.
RUN git clone --branch v2.5 https://github.com/tl-its-umich-edu/esbUtils \
&& cd esbUtils \
&& mvn clean install -Dmaven.test.skip=true
# Copy CCM code to local directory for building
COPY . /tmp
# Build CCM and place the resulting war in the tomcat dir.
RUN mvn clean install -Dmaven.test.skip=true \
&& mv ./target/canvasCourseManager.war /usr/local/tomcat/webapps
# Remove unnecessary build dependencies.
RUN apt-get remove -y maven git \
&& apt-get autoremove -y
# Download the YourKit to /usr/local for profiling. This will be commented out for production.
#WORKDIR /usr/local
#RUN wget https://www.yourkit.com/download/yjp-2017.02-b59.zip \
# && unzip yjp-2017.02-b59.zip
WORKDIR /usr/local/tomcat/webapps
# Set Opts, including paths for the CCM properties.
ENV JAVA_OPTS="-server \
-Xmx1028m \
-Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false \
-Djava.awt.headless=true -Dcom.sun.management.jmxremote \
-Dsun.lang.ClassLoader.allowArraySyntax=true \
-Dfile.encoding=UTF-8 \
-DccmPropsPathSecure=file:$CATALINA_HOME/conf/ccm-secure.properties \
-DccmPropsPath=file:$CATALINA_HOME/conf/ccm.properties \
-Dlog4j.configuration=file:/usr/local/tomcat/conf/log4j.properties \
"
# When need for profiling the application this option goes in the JAVA_OPTS
#-agentpath:/usr/local/yjp-2017.02/bin/linux-x86-64/libyjpagent.so=delay=10000,sessionname=Tomcat \
#apache port
EXPOSE 8009
#debug port
EXPOSE 5009
ENV JPDA_ADDRESS="5009"
ENV JPDA_TRANSPORT="dt_socket"
### change directory owner, as openshift user is in root group.
RUN chown -R root:root /usr/local/tomcat/logs /var/lock /var/run/lock
### Modify perms for the openshift user, who is not root, but part of root group.
#RUN chmod 777 /usr/local/tomcat/conf /usr/local/tomcat/conf/webapps
RUN chmod g+rw /usr/local/tomcat/conf /usr/local/tomcat/logs /usr/local/tomcat/webapps \
/usr/local/tomcat/conf/server.xml /var/lock /var/run/lock
# Launch Tomcat
#CMD cp /tmp/tomcat/* /usr/local/tomcat/conf/; cp /tmp/app/* /usr/local/tomcat/conf/; catalina.sh jpda run
### Start script incorporates config files and sends logs to stdout ###
COPY start.sh /usr/local/bin
RUN chmod 755 /usr/local/bin/start.sh
CMD /usr/local/bin/start.sh