To optimize Docker image size.

This commit is contained in:
yoan 2024-08-30 23:47:41 +08:00
parent 78877d0643
commit 6466d1fb0d

View File

@ -1,8 +1,16 @@
FROM ubuntu:latest
FROM golang:1.22-alpine as builder
WORKDIR /app
COPY certimate /app/certimate
COPY ../. /app/
RUN go build -o certimate
FROM alpine:latest
WORKDIR /app
COPY --from=builder /app/certimate .
ENTRYPOINT ["./certimate", "serve", "--http", "0.0.0.0:8090"]