File size: 2,208 Bytes
fe7913a fcb63c4 dd4c9f9 fe7913a 08fb6d7 dd4c9f9 33c66c1 08fb6d7 e609772 ef1514a dd4c9f9 ef1514a fe7913a 08fb6d7 fe7913a ef1514a e019435 ef1514a 7ad5894 dd4c9f9 c102014 08fb6d7 dd4c9f9 08fb6d7 fe7913a 08fb6d7 dd4c9f9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# Pull python 3.7 docker image
FROM python:3.7
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Create necessary directories
RUN mkdir -p /home/app/staticfiles/app/uploaded_videos/
RUN mkdir -p /home/app/staticfiles/app/uploaded_images/
WORKDIR /app
COPY . /app
# Install system dependencies for dlib
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
g++ \
wget \
unzip \
libopenblas-dev \
liblapack-dev \
libx11-dev && \
apt-get clean
# Install Rust and Cargo
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:$PATH"
# Install Python dependencies
RUN pip install --upgrade pip
RUN pip install opencv-python==4.2.0.32
RUN pip install protobuf
# Install dlib from a precompiled wheel if available
RUN pip install dlib-19.24.99-cp37-cp37m-linux_x86_64.whl
# Install remaining Python packages
RUN pip install altair asgiref astor attrs backcall base58 bleach blinker cachetools certifi chardet click colorama cycler decorator defusedxml Django docutils entrypoints enum-compat face-recognition face-recognition-models future google google-api-core google-api-python-client google-auth google-auth-httplib2 googleapis-common-protos httplib2 idna ipykernel ipython ipython-genutils ipywidgets jedi Jinja2 jmespath json5 jsonschema jupyter-client jupyter-core jupyterlab jupyterlab-server kiwisolver MarkupSafe matplotlib mistune nbconvert nbformat notebook numpy packaging pandas pandocfilters parso pathtools pickleshare Pillow prometheus-client prompt-toolkit pyasn1 pyasn1-modules pycodestyle pydeck Pygments pyparsing pyrsistent python-dateutil pytz pywinpty PyYAML pyzmq requests rsa s3transfer Send2Trash six soupsieve sqlparse terminado testpath toml toolz torch torchvision tornado traitlets tzlocal uritemplate urllib3 validators watchdog wcwidth webencodings widgetsnbextension
RUN chmod +x /app/bin/gunicorn_start.sh
# Copy application files
RUN mkdir -p /app/staticfiles /app/uploaded_videos /app/uploaded_images
RUN python manage.py collectstatic --noinput
RUN pip install gunicorn
# Expose volume and set entry point
VOLUME /app/run/
ENTRYPOINT ["/app/bin/gunicorn_start.sh"]
|