-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (24 loc) · 931 Bytes
/
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
FROM openjdk:18-jdk-buster as build
ENV SCALA_VERSION 2.13.8
ENV SBT_VERSION 1.6.2
# FROM https://github.com/hseeberger/scala-sbt
# Install Scala
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 -fsL "https://github.com/sbt/sbt/releases/download/v$SBT_VERSION/sbt-$SBT_VERSION.tgz" | tar xfz - -C /usr/share && \
chown -R root:root /usr/share/sbt && \
chmod -R 755 /usr/share/sbt && \
ln -s /usr/share/sbt/bin/sbt /usr/local/bin/sbt
WORKDIR /app
COPY . /app
RUN sbt assembly
FROM openjdk:18-alpine as server
ENV APP_VERSION 0.0.3
WORKDIR /app
COPY --from=build /app/target/scala-2.13/open-lifelogging-assembly-$APP_VERSION.jar /app/open-lifelogging.jar
EXPOSE 9001
CMD ["java", "-jar", "/app/open-lifelogging.jar"]