gateway_service/Dockerfile
AndreyIgorevich d9ffefd5f6 Add project
2025-07-10 01:10:47 +07:00

34 lines
615 B
Docker

FROM golang:1.24.3 AS builder
WORKDIR /app
COPY go.mod ./
COPY go.sum ./
RUN go mod download
COPY . .
RUN openssl req -x509 -newkey rsa:4096 \
-nodes -keyout /app/SSL/privkey.pem \
-out /app/SSL/fullchain.pem -days 365 \
-subj "/CN=localhost"
RUN CGO_ENABLED=0 GOOS=linux go build -o gateway ./cmd/gateway/main.go
FROM alpine:latest
RUN adduser -HD server
WORKDIR /app
COPY --from=builder /app/gateway /app/
COPY --from=builder /app/SSL /app/SSL
COPY ./configs /app/configs
COPY ./geodb /app/geodb
COPY ./.env /app/
RUN chown -R server:server /app
USER server
EXPOSE 5150
CMD ["/app/gateway"]