Spaces:
Sleeping
Sleeping
| FROM python:3.11-slim | |
| ARG DEBIAN_FRONTEND=noninteractive | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 \ | |
| PIP_NO_CACHE_DIR=1 \ | |
| PLAYWRIGHT_BROWSERS_PATH=/ms-playwright \ | |
| HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH \ | |
| HF_HOME=/home/user/.cache/huggingface | |
| RUN useradd -m -u 1000 user | |
| WORKDIR $HOME/app | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| tesseract-ocr \ | |
| libgl1 \ | |
| libglib2.0-0 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| RUN mkdir -p /ms-playwright "$HF_HOME" "$HOME/app/image_in_text_phantom_lint" \ | |
| && chown -R user:user /ms-playwright "$HOME" | |
| COPY --chown=user:user requirements-space.txt ./ | |
| RUN pip install --upgrade pip && pip install -r requirements-space.txt | |
| RUN python -m playwright install --with-deps chromium \ | |
| && chown -R user:user /ms-playwright | |
| USER user | |
| RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('all-MiniLM-L6-v2')" | |
| COPY --chown=user:user image_in_text_phantom_lint/app.py ./image_in_text_phantom_lint/ | |
| COPY --chown=user:user image_in_text_phantom_lint/forensics_backend.py ./image_in_text_phantom_lint/ | |
| COPY --chown=user:user image_in_text_phantom_lint/image_backend.py ./image_in_text_phantom_lint/ | |
| COPY --chown=user:user image_in_text_phantom_lint/phantom_ui.py ./image_in_text_phantom_lint/ | |
| COPY --chown=user:user image_in_text_phantom_lint/phantomlint ./image_in_text_phantom_lint/phantomlint | |
| EXPOSE 7860 | |
| CMD ["python", "image_in_text_phantom_lint/app.py"] | |