sanic/Dockerfile
2024-08-08 00:05:49 +02:00

23 lines
361 B
Docker

FROM docker.io/golang:1.22 as builder
WORKDIR /usr/src/app
COPY go.mod go.sum ./
RUN go mod download && go mod verify
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -v -o sanic ./...
# -----
FROM scratch as runner
WORKDIR /
COPY --from=builder /usr/src/app/sanic /sanic
COPY --from=builder /usr/src/app/static /static
EXPOSE 8080
ENTRYPOINT ["/sanic"]