Update Dockerfile
This commit is contained in:
+3
-3
@@ -6,11 +6,11 @@ WORKDIR /app
|
|||||||
# Install build dependencies
|
# Install build dependencies
|
||||||
RUN apk add --no-cache git ca-certificates
|
RUN apk add --no-cache git ca-certificates
|
||||||
|
|
||||||
# Copy all files first so Go has full package context
|
# Copy all source files
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Tidy and download dependencies with full visibility to resolve any checksum discrepancies
|
# Remove any outdated/corrupted go.sum and let Go regenerate a pristine, valid one
|
||||||
RUN go mod tidy && go mod download
|
RUN rm -f go.sum && go mod tidy && go mod download
|
||||||
|
|
||||||
# Build the application
|
# Build the application
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o blogging-cms .
|
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o blogging-cms .
|
||||||
|
|||||||
Reference in New Issue
Block a user