Spaces:
Sleeping
Sleeping
Download Dockerfile from knighter75/translate-api: direct link, hf CLI and curl.
- Browser
- Download file 712 Bytes
-
https://huggingface.co/spaces/knighter75/translate-api/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/knighter75/translate-api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/knighter75/translate-api/resolve/main/Dockerfile
712 Bytes
| FROM python:3.9-slim | |
| WORKDIR /app | |
| # Установка системных зависимостей (если нужны) | |
| RUN apt-get update && apt-get install -y --no-install-recommends gcc && \ | |
| apt-get clean && rm -rf /var/lib/apt/lists/* | |
| # Копируем requirements и устанавливаем зависимости | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # Копируем весь проект | |
| COPY . . | |
| # Создаем пользователя с UID 1000 (требование Hugging Face) | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| # Hugging Face ожидает порт 7860 | |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] |