Update Dockerfile
This commit is contained in:
+6
-5
@@ -6,11 +6,12 @@ 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 go mod files
|
# Copy go mod files safely handling missing or mismatched sum files
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod ./
|
||||||
|
COPY go.sum* ./
|
||||||
|
|
||||||
# Download dependencies
|
# Automatically tidy modules and download dependencies to prevent checksum errors
|
||||||
RUN go mod download
|
RUN go mod tidy && go mod download
|
||||||
|
|
||||||
# Copy source code
|
# Copy source code
|
||||||
COPY . .
|
COPY . .
|
||||||
@@ -45,4 +46,4 @@ EXPOSE 8080
|
|||||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
||||||
CMD wget --quiet --tries=1 --spider http://localhost:8080/ || exit 1
|
CMD wget --quiet --tries=1 --spider http://localhost:8080/ || exit 1
|
||||||
|
|
||||||
CMD ["./blogging-cms"]
|
CMD ["./blogging-cms"]
|
||||||
Reference in New Issue
Block a user