pcgamedb/Dockerfile

18 lines
437 B
Docker
Raw Normal View History

2024-09-24 06:17:11 -04:00
FROM golang:1.21-alpine AS builder
LABEL authors="Nite07"
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go install github.com/swaggo/swag/cmd/swag@latest
RUN swag init
2024-09-25 09:47:13 -04:00
ARG version=dev
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w -X pcgamedb/constant.Version=${version}" -o pcgamedb .
2024-09-24 06:17:11 -04:00
FROM alpine:latest
WORKDIR /app
COPY --from=builder /app/pcgamedb /app/pcgamedb
ENTRYPOINT ["/app/pcgamedb", "server"]