From a60b19398dfd1d99160eb608facf712e684dbe3b Mon Sep 17 00:00:00 2001 From: keven1024 Date: Mon, 2 Jun 2025 15:29:41 +0800 Subject: [PATCH] fix: remove redundant line in Dockerfile for backend and worker services to streamline Go module setup --- backend/Dockerfile | 6 ++++-- worker/Dockerfile | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 7a5ddb8..be163d6 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -7,12 +7,14 @@ WORKDIR /app # Download Go modules COPY go.mod go.sum ./ -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 *.go ./ +RUN go env -w GO111MODULE=on && go env -w GOPROXY=https://goproxy.cn,direct && go mod download + + + # Build RUN CGO_ENABLED=0 GOOS=linux go build -o /backend diff --git a/worker/Dockerfile b/worker/Dockerfile index 637f7a3..82305db 100644 --- a/worker/Dockerfile +++ b/worker/Dockerfile @@ -7,12 +7,12 @@ WORKDIR /app # Download Go modules COPY go.mod go.sum ./ -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 *.go ./ +RUN go env -w GO111MODULE=on && go env -w GOPROXY=https://goproxy.cn,direct && go mod download + # Build RUN CGO_ENABLED=0 GOOS=linux go build -o /worker