From 87331d43b0382e3032ed6cb699c9d752027a0bbf Mon Sep 17 00:00:00 2001 From: DM Date: Fri, 6 Jun 2025 15:54:13 +0300 Subject: [PATCH] Change Dockerfile to run Chproxy under non-root user --- Dockerfile | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index f9cf3024..bcc3bf9d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,20 @@ -FROM debian:12 +FROM debian:12-slim -RUN apt update && apt install -y ca-certificates curl +ARG USER=chproxy +ARG UID=1000 +ARG GID=$UID + +RUN groupadd -g $GID $USER && \ + useradd -u $UID -g $GID -m $USER && \ + apt update && \ + apt install -y ca-certificates curl COPY chproxy / EXPOSE 9090 +USER $USER + ENTRYPOINT ["/chproxy"] -CMD [ "--help" ] + +CMD ["--help"]