diff --git a/django/Dockerfile b/django/Dockerfile index 0e2789d5..c0f9c53f 100644 --- a/django/Dockerfile +++ b/django/Dockerfile @@ -4,6 +4,11 @@ WORKDIR /app EXPOSE 8000 VOLUME [ "/app" ] +RUN groupadd -r appUser && useradd -r -g appUser appUser +RUN chown appUser:appUser /app +RUN mkdir /static +RUN chown appUser:appUser /static + ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED=1 @@ -16,4 +21,6 @@ RUN pip install --no-cache-dir -r requirements.txt COPY conf/entrypoint.sh /entrypoint.sh RUN chmod a+x /entrypoint.sh +USER appUser + CMD [ "/entrypoint.sh" ]