fix: update Dockerfile to copy all source files for backend and worker services, improving build context

This commit is contained in:
keven1024
2025-06-02 15:43:37 +08:00
parent a60b19398d
commit 2f40b9ce78
2 changed files with 7 additions and 7 deletions

View File

@@ -7,13 +7,12 @@ WORKDIR /app
# Download Go modules
COPY go.mod go.sum ./
# Copy the source code. Note the slash at the end, as explained in
# https://docs.docker.com/engine/reference/builder/#copy
COPY *.go ./
RUN go env -w GO111MODULE=on && go env -w GOPROXY=https://goproxy.cn,direct && go mod download
# Copy the source code. Note the slash at the end, as explained in
# https://docs.docker.com/engine/reference/builder/#copy
COPY . .
# Build
RUN CGO_ENABLED=0 GOOS=linux go build -o /backend

View File

@@ -7,12 +7,13 @@ WORKDIR /app
# Download Go modules
COPY go.mod go.sum ./
# Copy the source code. Note the slash at the end, as explained in
# https://docs.docker.com/engine/reference/builder/#copy
COPY *.go ./
RUN go env -w GO111MODULE=on && go env -w GOPROXY=https://goproxy.cn,direct && go mod download
# Copy the source code. Note the slash at the end, as explained in
# https://docs.docker.com/engine/reference/builder/#copy
COPY . .
# Build
RUN CGO_ENABLED=0 GOOS=linux go build -o /worker