22 lines
449 B
Docker
22 lines
449 B
Docker
# 1. Python-Image verwenden
|
|
FROM python:3.11-alpine
|
|
|
|
# 2. Arbeitsverzeichnis im Container setzen
|
|
WORKDIR /app
|
|
|
|
# 3. production-style server mit gunicorn
|
|
RUN pip install gunicorn
|
|
|
|
# 4. requirements.txt kopieren und Pakete installieren
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
# 5. Quellcode kopieren (z.B. app.py)
|
|
COPY . .
|
|
|
|
ENV PYTHONUNBUFFERED=1
|
|
EXPOSE 5000
|
|
|
|
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "app:app"]
|