Spaces:
Running
Running
| ARG BASE_IMAGE=ghcr.io/meta-pytorch/openenv-base:latest | |
| FROM ${BASE_IMAGE} | |
| WORKDIR /app | |
| # Build tools | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends \ | |
| git git-lfs build-essential curl \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Enable git-lfs (required for HF model weights) | |
| RUN git lfs install | |
| # Copy source | |
| COPY . /app/env | |
| # Install dependencies (excluding openenv) | |
| RUN grep -v 'openenv' /app/env/requirements.txt | pip install -r /dev/stdin | |
| # Clone model directly into container (NO HF API at runtime) | |
| RUN git clone https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2 /app/model | |
| # Download NLTK data | |
| RUN python -m nltk.downloader \ | |
| wordnet omw-1.4 stopwords punkt \ | |
| averaged_perceptron_tagger_eng punkt_tab | |
| ENV PYTHONPATH="/app/env:$PYTHONPATH" | |
| HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ | |
| CMD curl -f http://localhost:7860/health || exit 1 | |
| ENTRYPOINT [] | |
| CMD ["python", "-m", "uvicorn", "server.app:app", \ | |
| "--host", "0.0.0.0", "--port", "7860", "--app-dir", "/app/env"] |