FROM python:3.12-slim

WORKDIR /app/code

# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy app
COPY app/ ./app/

# Cloudron runs as UID 1000
RUN mkdir -p /app/data && chown -R 1000:1000 /app/data /app/code
USER 1000

EXPOSE 8000

CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
