File size: 822 Bytes
173e9ec 81101bf 173e9ec | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | # Use Python 3.11 for compatibility with transformers/torch on HF Spaces
FROM python:3.11-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
curl \
git \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
# Set working directory
WORKDIR /app
# Copy dependency files
copy pyproject.toml .
copy uv.lock .
# Install dependencies using uv
RUN uv sync --frozen --no-cache
# Install Playwright browsers
RUN uv run playwright install --with-deps chromium
# Copy application code
COPY . .
# Create logs and data directories
RUN mkdir -p logs data
# Expose port
EXPOSE 7860
# Run the application
CMD ["uv", "run", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|