-
Notifications
You must be signed in to change notification settings - Fork 25
/
Dockerfile
45 lines (36 loc) · 1.36 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
FROM tomcat:7-jdk8-openjdk
MAINTAINER Steve Nolen <[email protected]>
# Report issues here: https://github.com/ohmage/server
RUN set -x \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install --no-install-recommends -y ant ant-optional netcat git\
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /usr/local/tomcat/webapps/ROOT \
&& rm -rf /usr/local/tomcat/webapps/docs \
&& rm -rf /usr/local/tomcat/webapps/examples \
&& rm -rf /usr/local/tomcat/webapps/manager \
&& rm -rf /usr/local/tomcat/webapps/host-manager
#### download flyway (ohmage doesn't do migrations) ####
WORKDIR /flyway
ENV FLYWAY_TGZ_URL https://repo1.maven.org/maven2/org/flywaydb/flyway-commandline/4.2.0/flyway-commandline-4.2.0-linux-x64.tar.gz
RUN set -x \
&& curl -fSL "$FLYWAY_TGZ_URL" -o flyway.tar.gz \
&& tar -xvf flyway.tar.gz --strip-components=1 \
&& rm flyway.tar.gz
WORKDIR /app
ADD . /app
RUN cp db/migration/* /flyway/sql/ \
&& ant clean dist \
&& cp dist/webapp-ohmage* "$CATALINA_HOME"/webapps/app.war \
&& cp docker_entrypoint.sh /run.sh \
&& chmod +x /run.sh \
&& rm -rf /app
RUN mkdir -p /var/lib/ohmage
RUN useradd -ms /bin/bash ohmage && \
chown -R ohmage.ohmage "$CATALINA_HOME" && \
chown -R ohmage.ohmage /var/lib/ohmage
EXPOSE 8080
VOLUME /var/lib/ohmage
CMD ["/run.sh"]