-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
48 lines (38 loc) · 1.15 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
FROM openjdk:11 as builder
# sbt versionを固定
ARG SBT_VERSION=1.2.8
# 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
# 必要なdebパッケージのインストール
RUN set -eux; \
apt-get update && \
apt-get install -y --no-install-recommends \
sbt && \
rm -rf /var/lib/apt/lists/*
RUN mkdir /opt/app
COPY . /opt/app
WORKDIR /opt/app
# コンパイル
RUN sbt sbtVersion
RUN sbt assembly
FROM openjdk:11-jre as runner
ARG EVENT_URL
ENV DEBIAN_FRONTEND=noninteractive
RUN set -eux; \
apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
tzdata && \
rm -rf /var/lib/apt/lists/*
RUN cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime && \
echo Asia/Tokyo > /etc/timezone
RUN mkdir /opt/app
WORKDIR /opt/app
COPY --from=builder /opt/app/target/scala-2.12/godfather.jar .
RUN groupadd --non-unique --gid 23456 cndjp
RUN useradd --non-unique --system --uid 12345 --gid 23456 godfather
USER godfather
CMD java -jar /opt/app/godfather.jar -e $EVENT_URL