# Basis-Image | |
FROM python:3.10-slim | |
# Arbeitsverzeichnis setzen | |
WORKDIR /code | |
# System-Dependencies | |
RUN apt-get update && \ | |
apt-get install -y --no-install-recommends \ | |
build-essential \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Requirements kopieren und installieren | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
# App-Code kopieren | |
COPY ./app /code/app | |
# Port freigeben | |
EXPOSE 7860 | |
# Healthcheck hinzufügen | |
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \ | |
CMD curl -f http://localhost:7860/ || exit 1 | |
# Start-Command | |
CMD ["python", "app/app.py"] |