-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
56 lines (42 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
46
47
48
49
50
51
52
53
54
55
56
# Builder
FROM openjdk:8-jdk-slim as builder
# Env variables
ENV SCALA_VERSION 2.12.8
ENV SBT_VERSION 1.2.8
WORKDIR /build
# Install sbt
RUN \
set -eux; \
apt-get update && \
apt-get install -y --no-install-recommends curl git && \
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 && \
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 && \
\
apt-get remove -y --auto-remove \
curl \
; \
rm -rf /var/lib/apt/lists/*;
COPY . /build
RUN sbt -mem 2048 stage
# Runtime
FROM openjdk:8-jre-slim
# Create a non root user for runtime
RUN addgroup jvm && \
adduser --system --disabled-login --shell /bin/false --home=/app jvm && \
adduser jvm jvm && chown jvm:jvm -R /app
WORKDIR /app
# Copy pre-build api to runtime container
COPY --from=builder /build/target/universal/stage ./
RUN chmod 755 -R /app/bin
USER jvm
# Create keystore directory
RUN mkdir /app/keystore
EXPOSE 9000
# Default play application entrypoint
ENTRYPOINT [ "bin/ton-api", "-Dpidfile.path=/dev/null", "-Dfile.encoding=UTF8" ]