Dockerfile-static
17 Zeilen · 470 B · Text
| 1 | FROM --platform=$TARGETPLATFORM golang:1.26-alpine AS quilldrop |
| 2 | WORKDIR /build |
| 3 | COPY go.mod go.sum ./ |
| 4 | RUN go mod download |
| 5 | COPY --exclude=static/images . . |
| 6 | RUN CGO_ENABLED=0 go build -o quilldrop |
| 7 | |
| 8 | FROM --platform=$TARGETPLATFORM nginx AS builder |
| 9 | WORKDIR /app |
| 10 | COPY --from=quilldrop /build/quilldrop ./quilldrop |
| 11 | COPY --exclude=static/images . . |
| 12 | RUN ./quilldrop generate |
| 13 | |
| 14 | |
| 15 | FROM --platform=$TARGETPLATFORM nginx |
| 16 | COPY --from=builder /app/output /usr/share/nginx/html |
| 17 | EXPOSE 80 |