From eb78f90d8f3922a6a19a087ba0b44d1385e63e1c Mon Sep 17 00:00:00 2001 From: SimolZimol <70102430+SimolZimol@users.noreply.github.com> Date: Fri, 12 Dec 2025 04:11:38 +0100 Subject: [PATCH] new file: Dockerfile new file: app.py new file: requirements.txt --- Dockerfile | 30 ++++++++++++++++++ app.py | 80 ++++++++++++++++++++++++++++++++++++++++++++++++ requirements.txt | 2 ++ 3 files changed, 112 insertions(+) create mode 100644 Dockerfile create mode 100644 app.py create mode 100644 requirements.txt diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..889c076 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +FROM python:3.10-slim + +ENV PYTHONDONTWRITEBYTECODE=1 \ + PYTHONUNBUFFERED=1 \ + PIP_NO_CACHE_DIR=1 \ + PORT=5000 + +WORKDIR /app + +# Keep image minimal; add build tools only if future deps require them +RUN apt-get update -y && apt-get install -y --no-install-recommends \ + build-essential \ + && rm -rf /var/lib/apt/lists/* + +# Install dependencies (better layer caching) +COPY requirements.txt ./ +RUN pip install --upgrade pip && pip install -r requirements.txt + +# Copy application code +COPY app.py ./ +COPY templates ./templates +COPY static ./static + +# Environment variables from Coolify (if used) +ENV DEMO=$DEMO + +EXPOSE 5000 + +# Production server (use shell form so $PORT expands in Coolify) +CMD gunicorn -w ${WEB_CONCURRENCY:-3} -b 0.0.0.0:${PORT:-5000} app:app diff --git a/app.py b/app.py new file mode 100644 index 0000000..5b20ca0 --- /dev/null +++ b/app.py @@ -0,0 +1,80 @@ +from flask import Flask, render_template_string + +app = Flask(__name__) + +MAINTENANCE_MESSAGE = """ + + + + + + Wartungsarbeiten + + + +
+
🔧
+

Wartungsarbeiten

+

Die Website projekt-senegal.de ist derzeit wegen Wartungsarbeiten nicht erreichbar.

+

Wir sind bald wieder für Sie da.
Vielen Dank für Ihr Verständnis!

+
+ + +""" + +@app.route("/") +def maintenance(): + return render_template_string(MAINTENANCE_MESSAGE) + +if __name__ == "__main__": + app.run(host="0.0.0.0", port=5000) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..13ad7a4 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +Flask==3.0.3 +gunicorn==21.2.0