dev-3 / Dockerfile
game-wake-wolf's picture
Update Dockerfile
4da5f0a verified
raw
history blame
352 Bytes
FROM golang:1.20-alpine AS builder
WORKDIR /app
COPY api/ ./api/
COPY go.mod go.sum ./
RUN apk add --no-cache gcc musl-dev
RUN go mod download
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o app ./api
FROM alpine:latest
WORKDIR /app
COPY --from=builder /app/app .
RUN apk add --no-cache ca-certificates
RUN chmod +x app
EXPOSE 8080
CMD ["./app"]