From 59e5676c26ac2ab92b4c9c520a0b62bff2dbfbac Mon Sep 17 00:00:00 2001 From: cialloo Date: Sun, 12 Oct 2025 11:12:24 +0800 Subject: [PATCH] fix: Correct working directory and file paths in Dockerfile for build process --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index e5674c4..e6f25e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ FROM golang:1.24.4-alpine AS builder RUN apk add --no-cache git # Set working directory -WORKDIR /app +WORKDIR /src # Copy go mod files from root directory COPY go.mod go.sum ./ @@ -17,7 +17,7 @@ RUN go mod download COPY app/ . # Build the application -RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o authenticator authenticator.go +RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o authenticator app/authenticator.go # Production stage FROM alpine:latest @@ -28,10 +28,10 @@ RUN apk --no-cache add ca-certificates WORKDIR /root/ # Copy binary from builder -COPY --from=builder /app/authenticator . +COPY --from=builder /src/authenticator . # Copy config file -COPY --from=builder /app/etc/authenticator.yaml ./etc/ +COPY --from=builder /src/app/etc/authenticator.yaml ./etc/ # Expose port EXPOSE 8888