-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (21 loc) · 946 Bytes
/
Copy pathDockerfile
File metadata and controls
26 lines (21 loc) · 946 Bytes
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
# docker build -t registry.gitlab.com/lilacashes/go-3/server .
# docker run [--net=host] -t registry.gitlab.com/lilacashes/go-3/server:latest
FROM hseeberger/scala-sbt:17.0.2_1.6.2_3.1.1 AS builder
ARG version=0.7.29
WORKDIR /go-3
COPY . /go-3
RUN sbt "Universal / packageBin"
RUN unzip -oq /go-3/target/universal/go-3d-${version}.zip
RUN mv go-3d-${version}/??? . && rm -r go-3d-*.*.* target
FROM eclipse-temurin:21-jre
ARG version=0.7.29
ENV SAVE_DIR=saves
ENV PORT=6030
WORKDIR /go-3
RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends jq curl time && rm -rf /var/lib/apt/lists/* && useradd go-3d && chown -R go-3d . && mkdir -p "${SAVE_DIR}"
USER go-3d
COPY --from=builder /go-3/bin /go-3/bin/
COPY --from=builder /go-3/lib /go-3/lib/
EXPOSE ${PORT}
ENTRYPOINT ["/bin/sh", "-c", "exec ./bin/runner --server --port $PORT --save-dir $SAVE_DIR"]
HEALTHCHECK CMD curl --fail http://localhost:${PORT}/health