-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
58 lines (46 loc) · 1.53 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
#
# Scala and sbt Dockerfile
#
# original file from
# https://github.com/hseeberger/scala-sbt
#
# Pull base image
FROM openjdk:8u151
# Env variables
ENV SCALA_VERSION 2.12.5
ENV SBT_VERSION 1.1.2
ENV APP_NAME timeslot
ENV APP_VERSION 1.4
# Scala expects this file
RUN touch /usr/lib/jvm/java-8-openjdk-amd64/release
# Install Scala
## Piping curl directly in tar
RUN \
curl -fsL https://downloads.typesafe.com/scala/$SCALA_VERSION/scala-$SCALA_VERSION.tgz | tar xfz - -C /root/ && \
echo >> /root/.bashrc && \
echo "export PATH=~/scala-$SCALA_VERSION/bin:$PATH" >> /root/.bashrc
# Install sbt
RUN \
curl -L -o sbt-$SBT_VERSION.deb https://dl.bintray.com/sbt/debian/sbt-$SBT_VERSION.deb && \
dpkg -i sbt-$SBT_VERSION.deb && \
rm sbt-$SBT_VERSION.deb && \
apt-get update && \
apt-get install sbt && \
sbt sbtVersion
# Define working directory
WORKDIR /root
ENV PROJECT_HOME /usr/src
# Pull latest TimeSlot code from Master branch
RUN git clone https://github.com/Burgundy-Labs/TimeSlot.git
# Pull in this apps credentials + application files (from local storage)
COPY ["application.conf", "TimeSlot/conf/application.conf"]
COPY ["credentials.json", "TimeSlot/conf/credentials.json"]
RUN \
cd TimeSlot && \
sbt update && \
sbt compile && \
sbt dist
EXPOSE 9000 5005 9443
RUN unzip TimeSlot/target/universal/$APP_NAME-$APP_VERSION.zip
RUN chmod +x $APP_NAME-$APP_VERSION/bin/$APP_NAME
ENTRYPOINT $APP_NAME-$APP_VERSION/bin/$APP_NAME -Dhttps.port=9443 -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005