]> git.r.bdr.sh - rbdr/mobius/blobdiff - Dockerfile
Update README.md
[rbdr/mobius] / Dockerfile
index bd7de5eb6eadaea4845626af2c0a68dfdd7f3ad6..f5b2af69cbdaf74185d34752a7f2f5ecee50d799 100644 (file)
@@ -1,22 +1,15 @@
-FROM golang:1.21 AS builder
+FROM golang:1.22 AS builder
 
 WORKDIR /app
 COPY . .
 
-RUN CGO_ENABLED=0 go build -o /app/server cmd/mobius-hotline-server/main.go && chmod a+x /app/server
+RUN CGO_ENABLED=0 go build -ldflags "-X main.version=$(git describe --exact-match --tags)" -o /app/server cmd/mobius-hotline-server/main.go && chmod a+x /app/server
 
-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
+FROM scratch
 
 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"]