Skip to content

Commit 765386b

Browse files
committed
updated Dockerfile
1 parent 2506feb commit 765386b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Dockerfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
FROM golang:1.24 AS builder
22

3-
WORKDIR /app
3+
WORKDIR /build
44
COPY . .
55

6-
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
6+
RUN go mod download
7+
8+
RUN go build -ldflags="-w -s" -o app .
79

810
FROM alpine:latest
911

1012
RUN apk --no-cache add ca-certificates
1113

12-
WORKDIR /root/
14+
WORKDIR /app
1315

14-
COPY --from=builder /app/app .
16+
COPY --from=builder /build/app .
1517

16-
CMD ["./app"]
18+
CMD ["./app"]

0 commit comments

Comments
 (0)