Security fix: don’t run as root

This commit is contained in:
Reese
2020-04-25 01:43:46 +00:00
parent e01bf28646
commit b04ef5a579

View File

@@ -6,7 +6,12 @@ COPY api api
COPY ui ui
COPY manage.py manage.py
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
RUN useradd -ms /bin/bash django
RUN chown -R django .
USER django
RUN pip install -r requirements.txt --user
RUN python manage.py collectstatic
CMD ["gunicorn","-b",":8000", "-w", "4", "config.wsgi"]