README und Dockerfile: Hinweis auf Gunicorn/WSGI und Produktion ergänzt
This commit is contained in:
11
Dockerfile
11
Dockerfile
@@ -6,17 +6,14 @@ WORKDIR /app
|
||||
|
||||
# Abhängigkeiten kopieren und installieren
|
||||
COPY requirements.txt ./
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
RUN pip install --no-cache-dir -r requirements.txt \
|
||||
&& pip install --no-cache-dir gunicorn
|
||||
|
||||
# App-Code kopieren
|
||||
COPY . .
|
||||
|
||||
# Flask-Umgebungsvariablen setzen
|
||||
ENV FLASK_APP=app.py
|
||||
ENV FLASK_RUN_HOST=0.0.0.0
|
||||
|
||||
# Exponiere Port 5000
|
||||
EXPOSE 5000
|
||||
|
||||
# Starte die App
|
||||
CMD ["flask", "run"]
|
||||
# Starte die App mit Gunicorn
|
||||
CMD ["gunicorn", "-b", "0.0.0.0:5000", "app:app"]
|
@@ -29,15 +29,18 @@ python app.py
|
||||
|
||||
Die App ist dann unter http://localhost:5000 erreichbar.
|
||||
|
||||
## Docker
|
||||
## Docker (empfohlen für Produktion)
|
||||
|
||||
Alternativ kann die App mit Docker gestartet werden:
|
||||
Die App läuft im Container mit dem WSGI-Server **Gunicorn**:
|
||||
|
||||
```
|
||||
docker build -t datumsrechner .
|
||||
docker run -p 5000:5000 datumsrechner
|
||||
```
|
||||
|
||||
- Gunicorn startet automatisch (siehe Dockerfile)
|
||||
- Empfohlen für produktiven Einsatz
|
||||
|
||||
## Entwicklung & Hinweise
|
||||
- Die HTML-Templates liegen im Ordner `templates/` (Trennung von Logik und Darstellung)
|
||||
- Das Projekt ist auf Gitea gehostet: https://gitea.elpatron.me/elpatron/datecalc
|
||||
|
Reference in New Issue
Block a user