test1 / Dockerfile
MFF212's picture
Update Dockerfile
a2cc738 verified
raw
history blame contribute delete
559 Bytes
# Hugging Face Spaces Docker SDK
FROM python:3.11-slim
# Create non-root user
RUN useradd -m -u 1000 user
USER user
# Set PATH for uv
ENV PATH="/home/user/.local/bin:$PATH"
# Set working directory
WORKDIR /app
# Install uv
RUN pip install --no-cache-dir uv
# Copy dependency files first (better caching)
COPY --chown=user pyproject.toml uv.lock* ./
# Sync dependencies
RUN uv sync
# Copy the rest of the app
COPY --chown=user . .
# ✅ START FASTAPI (THIS IS THE KEY FIX)
CMD ["uv", "run", "uvicorn", "bot:app", "--host", "0.0.0.0", "--port", "7860"]