]> git.r.bdr.sh - rbdr/mobius/blob - Dockerfile
Replace zap logger with slog
[rbdr/mobius] / Dockerfile
1 FROM golang:1.22 AS builder
2
3 WORKDIR /app
4 COPY . .
5
6 RUN CGO_ENABLED=0 go build -o /app/server cmd/mobius-hotline-server/main.go && chmod a+x /app/server
7
8 FROM debian:stable-slim
9
10 # Change these as you see fit. This makes bind mounting easier so you don't have to edit bind mounted config files as root.
11 ARG USERNAME=mobius
12 ARG UID=1001
13 ARG GUID=1001
14
15 COPY --from=builder /app/server /app/server
16 COPY --from=builder /app/cmd/mobius-hotline-server/mobius/config /usr/local/var/mobius/config
17 RUN useradd -d /app -u ${UID} ${USERNAME}
18 RUN chown -R ${USERNAME}:${USERNAME} /app
19 EXPOSE 5500 5501
20
21 USER ${USERNAME}
22 ENTRYPOINT ["/app/server"]