# Verwende das neueste Python-Image
FROM python:latest

# Setze das Arbeitsverzeichnis im Container
WORKDIR /app

# Kopiere Projektdateien für Abhängigkeitsmanagement
COPY . .

# Installiere pip und uv
RUN pip install --upgrade pip && \
    pip install uv

# Erstelle und aktiviere ein virtuelles Environment
RUN uv venv .venv && \
    . .venv/bin/activate

# Installiere die Abhängigkeiten aus pyproject.toml
RUN uv sync

# für Admin oberfläche
#RUN python manage.py createsuperuser

#COPY . .

RUN .venv/bin/python manage.py migrate

# Kopiere den Rest des Projekts in den Container


# Exponiere Port 8000 (für Django)
EXPOSE 8000

# Startbefehl (z. B. für Django-Projekt)
CMD ["uv", "run", "python", "manage.py", "runserver", "0.0.0.0:8000"]
