Spaces:
Sleeping
Sleeping
File size: 903 Bytes
5e080cb 21607d1 5e080cb 21607d1 5e080cb 21607d1 5e080cb 21607d1 5e080cb 21607d1 5e080cb 21607d1 | 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 | # Dockerfile
FROM python:3.10-slim
# Setze das Arbeitsverzeichnis im Container
WORKDIR /app # Dies ist das Verzeichnis, in dem uvicorn später ausgeführt wird
# Installiere Systemabhängigkeiten
RUN apt-get update && apt-get install -y --no-install-recommends \
cmake \
build-essential \
git \
&& rm -rf /var/lib/apt/lists/*
# Kopiere NUR die requirements.txt zuerst, um Docker Caching zu nutzen
COPY requirements.txt ./requirements.txt
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# Kopiere den Inhalt deines lokalen 'app'-Unterordners in das '/app'-Verzeichnis des Containers
COPY ./app/ .
# Jetzt liegt main.py direkt unter /app/main.py im Container
# ENV PYTHONPATH "${PYTHONPATH}:/app" # Sollte jetzt nicht mehr nötig sein, da WORKDIR /app ist
EXPOSE 7860
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |