From d0574703f7d33173fab077607f3652922c931a42 Mon Sep 17 00:00:00 2001 From: jordan Date: Sat, 7 Feb 2026 06:37:46 +0000 Subject: [PATCH] fix: add go mod download before build --- services/chat-svc/Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/chat-svc/Dockerfile b/services/chat-svc/Dockerfile index 43efff4..e7e3170 100644 --- a/services/chat-svc/Dockerfile +++ b/services/chat-svc/Dockerfile @@ -14,6 +14,10 @@ WORKDIR /app COPY pkg/ ./pkg/ COPY services/chat-svc/ ./services/chat-svc/ +# Download dependencies (populates go.sum if empty) +RUN cd pkg && go mod download +RUN cd services/chat-svc && go mod download + # Build from the service directory (uses replace directive for ../pkg) RUN cd services/chat-svc && CGO_ENABLED=0 go build -o /chat-svc ./cmd/server @@ -26,6 +30,6 @@ WORKDIR / COPY --from=builder /chat-svc /chat-svc -EXPOSE 8001 +EXPOSE 8002 ENTRYPOINT ["/chat-svc"]