forked from tl-its-umich-edu/spanish-placement-exam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
72 lines (55 loc) · 1.98 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
71
72
FROM openjdk:8u131-jdk
MAINTAINER Teaching and Learning <[email protected]>
# TODO: set time zone to be MI? Use NTP? See cpm (?)
# TODO: secure properties / secrets
# TODO: modify the entry point values for non-dev situations.
#### Setup environment
RUN apt-get update \
&& apt-get install -y maven
#### Get and build source
WORKDIR /tmp
## build the esbUtils (not directly available as a jar so build and install locally).
RUN git clone --branch v2.0 https://github.com/tl-its-umich-edu/esbUtils \
&& cd esbUtils \
&& pwd \
&& mvn clean install
## build the SPE application
COPY . /tmp
# Don't run tests test on OpenShift build
RUN mvn clean package -D maven.test.skip=true
#### CLEAN UP container
RUN apt-get remove -y maven git \
&& apt-get autoremove -y
RUN rm -rf ~/.m2
#RUN df -h /
############### assemble artifacts into /opt/spe #################
RUN mkdir -p /opt/spe-bin
RUN mv /tmp/target/spanish*jar /opt/spe-bin/spe.jar
####### NOTE: security files will handled as OS secrets
## install the configuration files
RUN mkdir -p /opt/spe/config
WORKDIR /tmp/config
#RUN ls -l /tmp/config
RUN cp /tmp/config/*properties /opt/spe/config/
# don't insist that yml files exist.
#RUN cp /tmp/config/*yml /opt/spe/config/; exit 0;
RUN cp /tmp/config/*json /opt/spe/config/
# Create directory to store persisted information.
# It will be external storage. SPE will automatically
# manage the contents.
RUN mkdir -p /opt/spe/persist
# ### set default command to be the SPE jar.
WORKDIR /opt/spe
#RUN find /opt/spe -ls
#RUN find /opt/spe-bin -ls
# set entry point so can add arguments from "docker run" on command line.
# EX: If start with:
# docker run -e TZ=America/New_York spe_a --spring.profiles.include=ZOMBIE
# ZOMBIE will be ADDED to the list of spring profiles to include.
#
ENTRYPOINT ["java", "-jar","/opt/spe-bin/spe.jar", \
"-Djava.security.egd=file:/dev/./urandom", \
"--test.skipRun=false", \
"--spring.profiles.include=OS"\
]
#end