31 lines
544 B
Docker
31 lines
544 B
Docker
FROM golang:1.24.3 AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY go.mod ./
|
|
COPY go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -o gateway ./cmd/gateway/main.go
|
|
|
|
FROM alpine:latest
|
|
ARG HOST_SSL_GROUP_GID=1005
|
|
RUN addgroup -g ${HOST_SSL_GROUP_GID} yobble-ssl-cert
|
|
RUN adduser -D -s /bin/sh -G yobble-ssl-cert server
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /app/gateway /app/
|
|
COPY ./configs /app/configs
|
|
COPY ./geodb /app/geodb
|
|
COPY ./.env /app/
|
|
|
|
RUN chown -R server:yobble-ssl-cert /app
|
|
USER server
|
|
|
|
EXPOSE 5150
|
|
CMD ["/app/gateway"]
|