Skip to content

Commit b80c15f

Browse files
fix: docker image building
1 parent 12012f5 commit b80c15f

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

Dockerfile

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
1-
## Build
2-
FROM golang as builder
1+
# syntax=docker/dockerfile:1
2+
3+
FROM golang:1.20-alpine AS build-stage
34

45
WORKDIR /app
56

6-
COPY go.mod ./
7-
COPY go.sum ./
7+
COPY go.mod go.sum ./
88

99
RUN go mod download
1010

1111
COPY internal/ ./internal/
1212
COPY cmd/ ./cmd/
1313
COPY pkg/ ./pkg/
1414

15-
RUN go build -o /server cmd/server/main.go
15+
RUN CGO_ENABLED=0 GOOS=linux go build -o /server
1616

17-
## Deploy
18-
FROM gcr.io/distroless/base-debian11
17+
FROM alpine:latest
1918

2019
WORKDIR /
2120

22-
COPY --from=builder /server /server
23-
24-
EXPOSE 8080
21+
COPY --from=build-stage /server /server
2522

26-
ENTRYPOINT ["/server"]
23+
ENTRYPOINT ["/server"]

0 commit comments

Comments
 (0)