# Use an official Python runtime as a parent image
FROM python:3.14

# Set environment variables
ENV PYTHONUNBUFFERED=1 \
  UV_COMPILE_BYTECODE=1 \
  UV_SYSTEM_PYTHON=true \
  UV_PYTHON_DOWNLOADS=never \
  UV_PROJECT_ENVIRONMENT=/usr/local

# Set the working directory in the container
WORKDIR /app

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

# Copy the project files into the container
COPY . /app/

# Install dependencies
RUN uv pip install ".[dev,postgres,valkey]"
RUN ["python", "manage.py", "collectstatic", "--noinput"]

# Command to run the application
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
