27 lines
749 B
Docker
27 lines
749 B
Docker
FROM python:3.8-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# System-Abhängigkeiten installieren (falls nötig)
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
build-essential \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Pip-Requirements mit vertrauenswürdigen PyPI-Hosts installieren
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir \
|
|
--trusted-host pypi.org \
|
|
--trusted-host pypi.python.org \
|
|
--trusted-host files.pythonhosted.org \
|
|
-r requirements.txt
|
|
|
|
# Quellcode kopieren
|
|
COPY src/ /app/src/
|
|
|
|
# Python-Pfad setzen, damit Imports wie `from endpoint_compare import ...` funktionieren
|
|
ENV PYTHONPATH=/app/src/API:/app/src
|
|
|
|
EXPOSE 8000
|
|
|
|
# Standard-Startbefehl
|
|
CMD ["uvicorn", "fastAPI:app", "--host", "0.0.0.0", "--port", "8000"]
|