File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 11# Build Stage
22FROM golang:1.23.4 AS builder
3+ ENV CGO_ENABLED=0 \
4+ GOOS=linux
35
46WORKDIR /app
57
@@ -12,17 +14,14 @@ RUN go mod download
1214COPY . ./
1315
1416# Disable CGO and set target OS to Linux for a portable static binary
15- RUN CGO_ENABLED=0 GOOS=linux go build -v -o /techbloghub-server ./cmd/main.go
17+ RUN go build -o /techbloghub-server ./cmd/main.go
1618
1719
1820# Final Stage
19- FROM alpine:latest
20-
21- # add package
22- RUN apk --no-cache add ca-certificates
21+ FROM alpine:latest AS deployment
2322
2423# copy only built binaries
25- COPY --from=builder /techbloghub-server /techbloghub-server
24+ COPY --from=builder /techbloghub-server ./
2625
2726# Optional:
2827# To bind to a TCP port, runtime parameters must be supplied to the docker command.
@@ -32,4 +31,4 @@ COPY --from=builder /techbloghub-server /techbloghub-server
3231EXPOSE 8080
3332
3433# Run
35- CMD ["/techbloghub-server" ]
34+ CMD [". /techbloghub-server" ]
You can’t perform that action at this time.
0 commit comments