Run backend as non-root user
This commit is contained in:
parent
625291b4bf
commit
cd93fe8708
1 changed files with 6 additions and 4 deletions
|
@ -7,10 +7,12 @@ RUN apt update \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& apt clean
|
&& apt clean
|
||||||
|
|
||||||
COPY ./requirements.txt /app/requirements.txt
|
|
||||||
|
|
||||||
RUN pip install -U --no-cache-dir -r requirements.txt
|
|
||||||
|
|
||||||
COPY . /app
|
COPY . /app
|
||||||
|
|
||||||
|
RUN pip install -U --no-cache-dir -r requirements.txt && \
|
||||||
|
useradd -Mu 1000 righttree && \
|
||||||
|
chown -R righttree:righttree /app
|
||||||
|
|
||||||
ENV DJANGO_SETTINGS_MODULE="right_tree.settings"
|
ENV DJANGO_SETTINGS_MODULE="right_tree.settings"
|
||||||
|
|
||||||
|
USER righttree
|
||||||
|
|
Loading…
Reference in a new issue