| |
| |
| |
| |
| |
|
|
| FROM python:3.11-slim |
|
|
| ENV PYTHONDONTWRITEBYTECODE=1 \ |
| PYTHONUNBUFFERED=1 \ |
| PIP_NO_CACHE_DIR=1 \ |
| PIP_DISABLE_PIP_VERSION_CHECK=1 \ |
| TRANSFORMERS_NO_ADVISORY_WARNINGS=1 \ |
| HF_HUB_DISABLE_TELEMETRY=1 \ |
| HF_HOME=/data/hf-cache |
|
|
| |
| RUN apt-get update \ |
| && apt-get install -y --no-install-recommends \ |
| libjpeg62-turbo libpng16-16 libtiff6 libwebp7 \ |
| libheif1 libopenjp2-7 zlib1g \ |
| tesseract-ocr tesseract-ocr-fra tesseract-ocr-ita \ |
| tesseract-ocr-eng tesseract-ocr-spa tesseract-ocr-deu \ |
| curl ca-certificates \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN useradd --create-home --uid 1000 fizello \ |
| && mkdir -p /data/hf-cache /app \ |
| && chown -R fizello:fizello /data /app |
|
|
| WORKDIR /app |
|
|
| |
| |
| COPY --chown=fizello:fizello requirements.txt . |
| RUN pip install --no-cache-dir --index-url https://download.pytorch.org/whl/cpu \ |
| torch==2.4.1 torchvision==0.19.1 \ |
| && pip install --no-cache-dir -r requirements.txt |
|
|
| |
| |
| |
| RUN python -c "from huggingface_hub import snapshot_download; \ |
| snapshot_download('prithivMLmods/Deep-Fake-Detector-v2-Model'); \ |
| snapshot_download('Organika/sdxl-detector')" \ |
| && chown -R fizello:fizello /data |
|
|
| |
| COPY --chown=fizello:fizello app ./app |
| COPY --chown=fizello:fizello static ./static |
|
|
| USER fizello |
|
|
| |
| ENV PORT=7860 |
| EXPOSE 7860 |
|
|
| HEALTHCHECK --interval=30s --timeout=5s --start-period=120s --retries=3 \ |
| CMD curl -fsS http://localhost:${PORT}/health || exit 1 |
|
|
| |
| CMD ["sh", "-c", "uvicorn app.main:app --host 0.0.0.0 --port ${PORT}"] |