-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
42 lines (28 loc) · 1.38 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
FROM openjdk:8 AS build-env
ENV ACTIVATOR_VERSION 1.3.11
ARG USER_HOME_DIR="/root"
# Add cerificates that ensure download of dependencies works:
RUN apt-get install -y ca-certificates-java && \
update-ca-certificates
# Install Typesafe Activator
RUN cd /tmp && \
wget -q http://downloads.typesafe.com/typesafe-activator/$ACTIVATOR_VERSION/typesafe-activator-$ACTIVATOR_VERSION.zip && \
unzip -q typesafe-activator-$ACTIVATOR_VERSION.zip -d /usr/local
RUN mv /usr/local/activator-dist-$ACTIVATOR_VERSION /usr/local/activator && \
rm /tmp/typesafe-activator-$ACTIVATOR_VERSION.zip
COPY . /mementos
COPY .git /mementos/.git
WORKDIR /mementos
# Patch in the version tag:
RUN git fetch -t && export VERSION=`git describe --tags --always` && sed -i -r 's|version := ".*"|version := "'${VERSION}'"|' build.sbt || exit 0
# Run without failing to try to download all dependencies:
RUN /usr/local/activator/bin/activator stage || exit 0
RUN /usr/local/activator/bin/activator stage || exit 0
# Perform a full clean build:
RUN rm -fr target
RUN /usr/local/activator/bin/activator clean stage
EXPOSE 9000
#VOLUME "$USER_HOME_DIR/.ivy2"
FROM openjdk:8-jre
COPY --from=build-env /mementos/target/universal/stage /mementos
CMD /mementos/bin/mementos-webclient -Dconfig.file=/mementos/conf/application.conf -Dpidfile.path=/dev/null