Spaces:
Runtime error
Runtime error
| # base image | |
| FROM python:3.8.12 | |
| LABEL org.opencontainers.image.source https://github.com/serengil/deepface | |
| # ----------------------------------- | |
| # create required folder | |
| RUN mkdir /app | |
| RUN mkdir /app/deepface | |
| RUN useradd -m -u 1000 user | |
| # ----------------------------------- | |
| # switch to application directory | |
| WORKDIR /app | |
| # ----------------------------------- | |
| # update image os | |
| RUN apt-get update | |
| RUN apt-get install ffmpeg libsm6 libxext6 -y | |
| # ----------------------------------- | |
| # Copy required files from repo into image | |
| COPY --chown=user ./deepface /app/deepface | |
| # even though we will use local requirements, this one is required to perform install deepface from source code | |
| COPY --chown=user ./requirements.txt /app/requirements.txt | |
| COPY --chown=user ./requirements_local /app/requirements_local.txt | |
| COPY --chown=user ./package_info.json /app/ | |
| COPY --chown=user ./setup.py /app/ | |
| COPY --chown=user ./README.md /app/ | |
| COPY --chown=user . /app | |
| # ----------------------------------- | |
| # if you plan to use a GPU, you should install the 'tensorflow-gpu' package | |
| # RUN pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host=files.pythonhosted.org tensorflow-gpu | |
| # ----------------------------------- | |
| # install deepface from pypi release (might be out-of-date) | |
| # RUN pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host=files.pythonhosted.org deepface | |
| # ----------------------------------- | |
| # install dependencies - deepface with these dependency versions is working | |
| RUN pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host=files.pythonhosted.org -r /app/requirements_local.txt | |
| # install deepface from source code (always up-to-date) | |
| RUN pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host=files.pythonhosted.org -e . | |
| # ----------------------------------- | |
| # some packages are optional in deepface. activate if your task depends on one. | |
| # RUN pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host=files.pythonhosted.org cmake==3.24.1.1 | |
| # RUN pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host=files.pythonhosted.org dlib==19.20.0 | |
| # RUN pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host=files.pythonhosted.org lightgbm==2.3.1 | |
| # ----------------------------------- | |
| # environment variables | |
| ENV PYTHONUNBUFFERED=1 | |
| # ----------------------------------- | |
| # run the app (re-configure port if necessary) | |
| WORKDIR /app/deepface/api/src | |
| EXPOSE 7860 | |
| CMD ["gunicorn", "--workers=1", "--timeout=3600", "--bind=0.0.0.0:7860", "app:create_app()"] | |