15 lines
513 B
Docker
15 lines
513 B
Docker
FROM python:3.12-slim
|
|
|
|
WORKDIR /app
|
|
ENV HF_HOME=/cache PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir torch==2.9.1 --index-url https://download.pytorch.org/whl/cpu \
|
|
&& pip install --no-cache-dir -r requirements.txt \
|
|
&& mkdir -p /cache && chown 65532:65532 /cache
|
|
|
|
COPY main.py .
|
|
USER 65532:65532
|
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080", "--limit-concurrency", "32", "--timeout-graceful-shutdown", "30", "--no-access-log"]
|
|
|