Download Dockerfile from Arsive/lt_space: direct link, hf CLI and curl.
- Browser
- Download file 1.18 kB
-
https://huggingface.co/spaces/Arsive/lt_space/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Arsive/lt_space/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Arsive/lt_space/resolve/main/Dockerfile
1.18 kB
| FROM python:3.10-slim | |
| LABEL maintainer="Universal Translator Team" | |
| LABEL description="Universal Translator API with CTranslate2 optimization" | |
| # Set environment variables | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 \ | |
| CT2_MODEL_CACHE=/app/.cache/ct2_models \ | |
| NLTK_DATA=/app/nltk_data | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| cmake \ | |
| git \ | |
| wget \ | |
| curl \ | |
| unzip \ | |
| pkg-config \ | |
| libpoppler-cpp-dev \ | |
| poppler-utils \ | |
| libgl1-mesa-glx \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Create directories | |
| WORKDIR /app | |
| RUN mkdir -p /app/app/models /app/.cache/ct2_models /app/nltk_data | |
| # Copy requirements first for better caching | |
| COPY requirements.txt . | |
| # Install dependencies | |
| RUN pip install --upgrade pip && \ | |
| pip install -r requirements.txt | |
| # Copy application files | |
| COPY . . | |
| # Set permissions | |
| RUN chmod -R 777 /app/.cache/ct2_models && \ | |
| python -c "import nltk; nltk.download('punkt', download_dir='/app/nltk_data')" | |
| # Expose the port | |
| EXPOSE 7860 | |
| # Start the application | |
| CMD ["uvicorn", "api_server:app", "--host", "0.0.0.0", "--port", "7860"] |