fix: update Dockerfile to use correct working directory and execute as user
This commit is contained in:
parent
1b325169cf
commit
7a5018bc5e
@ -13,9 +13,13 @@ RUN go build -o gosearch .
|
|||||||
# Use a minimal base image for final deployment
|
# Use a minimal base image for final deployment
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
# Set working directory in the container
|
# Set working directory in the container
|
||||||
WORKDIR /root/
|
WORKDIR /
|
||||||
# Copy the built binary from the builder stage
|
# Copy the built binary from the builder stage
|
||||||
COPY --from=builder /app/gosearch .
|
COPY --from=builder /app/gosearch .
|
||||||
|
# Add executing User
|
||||||
|
RUN addgroup gosearch
|
||||||
|
RUN useradd -g gosearch gosearch
|
||||||
|
USER gosearch
|
||||||
# Expose the application port
|
# Expose the application port
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
# Run the application
|
# Run the application
|
||||||
|
Loading…
x
Reference in New Issue
Block a user