Translate / Dockerfile
Rajhuggingface4253's picture
Rename dockerfile to Dockerfile
6fa1ea0 verified
raw
history blame contribute delete
725 Bytes
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"]