Skip to content

Commit 5a647a8

Browse files
committed
chore: try to minimize the size
1 parent 83711f4 commit 5a647a8

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

plate-server/Dockerfile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
FROM golang:alpine
2-
1+
# Build stage
2+
FROM golang:alpine AS builder
33
WORKDIR /app
44

55
COPY go.mod go.sum ./
6-
76
RUN go mod download && go mod verify
87

98
COPY . .
10-
119
RUN CGO_ENABLED=0 GOOS=linux go build -o /server
1210

13-
CMD ["/server"]
11+
# Final stage
12+
FROM alpine:latest
13+
WORKDIR /
14+
COPY --from=builder /server /server
15+
16+
# Minimal runtime
17+
CMD ["/server"]

0 commit comments

Comments
 (0)