]>
Commit | Line | Data |
---|---|---|
bdd21a62 | 1 | FROM golang:1.21 AS builder |
6988a057 JH |
2 | |
3 | WORKDIR /app | |
4 | COPY . . | |
5 | ||
bc385afd | 6 | RUN CGO_ENABLED=0 go build -o /app/server cmd/mobius-hotline-server/main.go && chmod a+x /app/server |
6988a057 | 7 | |
5f81c5c8 CJ |
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 | |
75b7ce6f | 14 | |
bc385afd | 15 | COPY --from=builder /app/server /app/server |
75b7ce6f | 16 | COPY --from=builder /app/cmd/mobius-hotline-server/mobius/config /usr/local/var/mobius/config |
5f81c5c8 CJ |
17 | RUN useradd -d /app -u ${UID} ${USERNAME} |
18 | RUN chown -R ${USERNAME}:${USERNAME} /app | |
75b7ce6f | 19 | EXPOSE 5500 5501 |
bddd9d4a | 20 | |
5f81c5c8 | 21 | USER ${USERNAME} |
8796b449 | 22 | ENTRYPOINT ["/app/server"] |