From 7a5018bc5e025ed4b95a8888644f3d824bde48c7 Mon Sep 17 00:00:00 2001 From: Alex Wellnitz Date: Wed, 26 Mar 2025 16:36:29 +0100 Subject: [PATCH] fix: update Dockerfile to use correct working directory and execute as user --- Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8cda807..0aa2919 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,9 +13,13 @@ RUN go build -o gosearch . # Use a minimal base image for final deployment FROM alpine:latest # Set working directory in the container -WORKDIR /root/ +WORKDIR / # Copy the built binary from the builder stage COPY --from=builder /app/gosearch . +# Add executing User +RUN addgroup gosearch +RUN useradd -g gosearch gosearch +USER gosearch # Expose the application port EXPOSE 3000 # Run the application