Spaces:
Running
Running
File size: 1,035 Bytes
bc88e75 bf2c053 a5c72cb bf2c053 5c02cc0 a5c72cb bf2c053 bc88e75 475623e bc88e75 | 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 | FROM python:3.11-slim AS app
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
PYTHONPATH=/app/src \
FACEVERIFICATION_DEVICE=cpu
WORKDIR /app
RUN apt-get update && apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip setuptools "wheel>=0.46.2"
RUN pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu -r requirements.txt
COPY pyproject.toml README.md ./
COPY src ./src
RUN useradd --create-home --shell /usr/sbin/nologin appuser \
&& mkdir -p /data/chroma \
&& chown -R appuser:appuser /app /data
USER appuser
EXPOSE 8000 7860
FROM app AS fastapi
CMD ["uvicorn", "faceverification.interfaces.fastapi_app:app", "--host", "0.0.0.0", "--port", "8000"]
FROM app AS gradio
ENV GRADIO_SERVER_NAME=0.0.0.0 \
GRADIO_SERVER_PORT=7860
CMD ["python", "-m", "faceverification.interfaces.gradio_app"]
|