mirror of https://github.com/doccano/doccano.git
pythondatasetsactive-learningtext-annotationdatasetnatural-language-processingdata-labelingmachine-learningannotation-tool
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.0 KiB
40 lines
1.0 KiB
ARG PYTHON_VERSION="3.9.6-slim-buster"
|
|
FROM python:${PYTHON_VERSION}
|
|
|
|
CMD ["python3"]
|
|
|
|
WORKDIR /backend
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE 1
|
|
ENV PYTHONUNBUFFERED 1
|
|
|
|
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
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends \
|
|
netcat=1.* \
|
|
libpq-dev=11.* \
|
|
unixodbc-dev=2.* \
|
|
g++=4:* \
|
|
&& pip install --upgrade pip \
|
|
&& pip install --no-cache-dir pipenv \
|
|
&& pipenv install --system --deploy \
|
|
&& pip uninstall -y pipenv virtualenv-clone virtualenv \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --chown=doccano:doccano tools/ /opt/bin/
|
|
RUN mkdir -p /backend/staticfiles \
|
|
&& mkdir -p /backend/client/dist/static \
|
|
&& mkdir -p /backend/media \
|
|
&& chown -R doccano:doccano /backend/
|
|
|
|
USER doccano:doccano
|
|
VOLUME /backend/staticfiles
|
|
|
|
ENTRYPOINT [ "/opt/bin/prod-django.sh" ]
|