Browse Source

Update backend container not to use super user

pull/1379/head
Hironsan 3 years ago
parent
commit
27b68c40da
1 changed files with 11 additions and 3 deletions
  1. 14
      backend/Dockerfile.prod

14
backend/Dockerfile.prod

@ -8,8 +8,11 @@ WORKDIR /backend
ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1 ENV PYTHONUNBUFFERED 1
COPY ./backend/ /backend/
COPY ./Pipfile* /backend/
RUN groupadd -g 61000 doccano \
&& useradd -g 61000 -l -M -s /bin/false -u 61000 doccano
COPY --chown=doccano:doccano ./backend/ /backend/
COPY --chown=doccano:doccano ./Pipfile* /backend/
# hadolint ignore=DL3013 # hadolint ignore=DL3013
RUN apt-get update \ RUN apt-get update \
@ -24,6 +27,11 @@ RUN apt-get update \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
COPY tools/ /opt/bin/
COPY --chown=doccano:doccano tools/ /opt/bin/
RUN mkdir -p /backend/staticfiles \
&& chown -R doccano:doccano /backend/staticfiles
USER doccano:doccano
VOLUME /backend/staticfiles
ENTRYPOINT [ "/opt/bin/prod-django.sh" ] ENTRYPOINT [ "/opt/bin/prod-django.sh" ]
Loading…
Cancel
Save