X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/bddd9d4a1c91b174d00a21f14603459d2469aac3..5d87f76eeb76e4e67e5dabb2c835a640a7ab7652:/Dockerfile?ds=sidebyside diff --git a/Dockerfile b/Dockerfile index 5ed9bfc..75f324b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,22 @@ -FROM golang:1.18 +FROM golang:1.22 AS builder WORKDIR /app COPY . . -RUN go build -o /app/server/server cmd/mobius-hotline-server/main.go \ - && chmod a+x /app/server/server +RUN CGO_ENABLED=0 go build -o /app/server cmd/mobius-hotline-server/main.go && chmod a+x /app/server -EXPOSE 5500 5501 +FROM debian:stable-slim + +# Change these as you see fit. This makes bind mounting easier so you don't have to edit bind mounted config files as root. +ARG USERNAME=mobius +ARG UID=1001 +ARG GUID=1001 -WORKDIR /app/server/ -CMD ["./server"] +COPY --from=builder /app/server /app/server +COPY --from=builder /app/cmd/mobius-hotline-server/mobius/config /usr/local/var/mobius/config +RUN useradd -d /app -u ${UID} ${USERNAME} +RUN chown -R ${USERNAME}:${USERNAME} /app +EXPOSE 5500 5501 +USER ${USERNAME} +ENTRYPOINT ["/app/server"]