FROM python:3.12-slim

WORKDIR /app

# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv

# Copy project files
COPY pyproject.toml .python-version ./
COPY app/ ./app/
COPY static/ ./static/

# Create directories for data
RUN mkdir -p uploads thumbnails images

# Install dependencies and project
RUN uv sync --no-dev

# Expose port
EXPOSE 8000

# Run server
CMD ["uv", "run", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
