From c580eb9ed2dd2cf060e3b5e99b3c24f2eda5f77a Mon Sep 17 00:00:00 2001 From: Hleb Kanonik <50049166+hlebkanonik@users.noreply.github.com> Date: Thu, 7 Dec 2023 13:46:46 +0100 Subject: [PATCH] Update Dockerfile --- Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index c567d0b3..f7143e8e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,16 +40,17 @@ FROM --platform=${BUILDPLATFORM} python:3.10.13-slim RUN apt-get update && apt-get -y upgrade \ && apt-get install -y libxml2 libgomp1 curl libpcre3 libpcre3-dev \ && rm -rf /var/lib/apt/lists/* + +# Create a group and user +RUN groupadd uwsgi && useradd -g uwsgi uwsgi +USER uwsgi + COPY --from=builder /venv /venv RUN mkdir /usr/share/nltk_data && chmod g+w /usr/share/nltk_data COPY --from=builder /usr/share/nltk_data /usr/share/nltk_data/ WORKDIR /backend/ COPY --from=builder /backend ./ -# Create a group and user -RUN groupadd uwsgi && useradd -g uwsgi uwsgi -USER uwsgi - EXPOSE 5001 ENV VIRTUAL_ENV="/venv"