Spaces:
Running
Running
File size: 725 Bytes
f76ca2a | 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 | FROM python:3.12-slim
WORKDIR /app
# Install deps
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu \
&& python -c "import nltk; nltk.download('punkt'); nltk.download('punkt_tab')" \
&& apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
# Copy app
COPY app.py .
# Env and expose
ENV QUANTIZED=true \
MODEL_CACHE_DIR=/app/models/nllb-600m-ct2 \
PYTHONUNBUFFERED=1
EXPOSE 7860
# Healthcheck
HEALTHCHECK --interval=30s --timeout=3s --start-period=60s --retries=3 \
CMD curl -f http://localhost:7860/health || exit 1
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
|