new file: Dockerfile new file: __pycache__/app.cpython-310.pyc new file: app.py new file: requirements.txt new file: static/css/style.css new file: templates/base.html new file: templates/index.html new file: templates/weather.html
34 lines
686 B
Docker
34 lines
686 B
Docker
# DWD Wetter
|
|
FROM python:3.11-slim
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY . .
|
|
|
|
EXPOSE 5000
|
|
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV FLASK_APP=app.py
|
|
ENV FLASK_ENV=production
|
|
|
|
# Non-root user
|
|
RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
|
|
USER appuser
|
|
|
|
# 4 workers, 120s timeout (DWD requests can be slow)
|
|
CMD ["gunicorn", \
|
|
"--bind", "0.0.0.0:5000", \
|
|
"--workers", "4", \
|
|
"--timeout", "120", \
|
|
"--keep-alive", "5", \
|
|
"--access-logfile", "-", \
|
|
"--error-logfile", "-", \
|
|
"app:app"]
|
|
|