sanic/Dockerfile

23 lines
361 B
Docker
Raw Permalink Normal View History

2024-07-15 20:00:18 +02:00
FROM docker.io/golang:1.22 as builder
2024-01-22 12:37:28 +01:00
2024-08-08 00:05:49 +02:00
WORKDIR /usr/src/app
2024-01-22 12:37:28 +01:00
2024-08-08 00:05:49 +02:00
COPY go.mod go.sum ./
RUN go mod download && go mod verify
2024-01-22 12:37:28 +01:00
2024-08-08 00:05:49 +02:00
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -v -o sanic ./...
2024-01-22 12:37:28 +01:00
# -----
FROM scratch as runner
WORKDIR /
2024-08-08 00:05:49 +02:00
COPY --from=builder /usr/src/app/sanic /sanic
COPY --from=builder /usr/src/app/static /static
2024-01-22 12:37:28 +01:00
EXPOSE 8080
ENTRYPOINT ["/sanic"]