modified: Dockerfile

new file:   go.sum
add go.sum file in hadle mod
This commit is contained in:
2025-09-25 03:13:42 +05:00
parent 61c5a70534
commit c2c48f5f9c
2 changed files with 9 additions and 18 deletions
+8 -17
View File
@@ -1,23 +1,14 @@
# Use official Go image with specific version
FROM golang:1.25.1
# Set working directory
# Build stage
FROM golang:1.25.1 as builder
WORKDIR /app
# Copy Go module files first
COPY go.mod go.sum ./
# Download dependencies
RUN go mod download
# Copy source code
COPY *.go ./
RUN CGO_ENABLED=0 GOOS=linux go build -o /go/bin/app
# Build the binary
RUN CGO_ENABLED=0 GOOS=linux go build -o main .
# Expose port
# Final stage
FROM gcr.io/distroless/static-debian12
WORKDIR /
COPY --from=builder /go/bin/app /app
CMD ["/app"]
EXPOSE 8080
# Run the application
CMD ["./main"]
View File