new file: Dockerfile
new file: app.py new file: requirements.txt
This commit is contained in:
30
Dockerfile
Normal file
30
Dockerfile
Normal file
@@ -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
|
||||
80
app.py
Normal file
80
app.py
Normal file
@@ -0,0 +1,80 @@
|
||||
from flask import Flask, render_template_string
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
MAINTENANCE_MESSAGE = """
|
||||
<!DOCTYPE html>
|
||||
<html lang=\"de\">
|
||||
<head>
|
||||
<meta charset=\"UTF-8\">
|
||||
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
|
||||
<title>Wartungsarbeiten</title>
|
||||
<style>
|
||||
body {
|
||||
min-height: 100vh;
|
||||
margin: 0;
|
||||
background: linear-gradient(135deg, #e0eafc 0%, #cfdef3 100%);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-family: 'Segoe UI', Arial, sans-serif;
|
||||
}
|
||||
.container {
|
||||
background: #fff;
|
||||
padding: 2.5rem 3.5rem;
|
||||
border-radius: 18px;
|
||||
box-shadow: 0 6px 32px rgba(0,0,0,0.12);
|
||||
text-align: center;
|
||||
max-width: 420px;
|
||||
}
|
||||
h1 {
|
||||
color: #00796b;
|
||||
font-size: 2.2rem;
|
||||
margin-bottom: 1.2rem;
|
||||
}
|
||||
p {
|
||||
color: #333;
|
||||
font-size: 1.1rem;
|
||||
margin-bottom: 0.8rem;
|
||||
}
|
||||
a {
|
||||
color: #00796b;
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
a:hover {
|
||||
color: #004d40;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.icon {
|
||||
font-size: 3.5rem;
|
||||
margin-bottom: 0.7rem;
|
||||
color: #00796b;
|
||||
}
|
||||
@media (max-width: 600px) {
|
||||
.container {
|
||||
padding: 1.2rem 0.5rem;
|
||||
max-width: 98vw;
|
||||
}
|
||||
h1 { font-size: 1.4rem; }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class=\"container\">
|
||||
<div class=\"icon\">🔧</div>
|
||||
<h1>Wartungsarbeiten</h1>
|
||||
<p>Die Website <a href=\"https://projekt-senegal.de/\">projekt-senegal.de</a> ist derzeit wegen Wartungsarbeiten nicht erreichbar.</p>
|
||||
<p>Wir sind bald wieder für Sie da.<br>Vielen Dank für Ihr Verständnis!</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
"""
|
||||
|
||||
@app.route("/")
|
||||
def maintenance():
|
||||
return render_template_string(MAINTENANCE_MESSAGE)
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host="0.0.0.0", port=5000)
|
||||
2
requirements.txt
Normal file
2
requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
Flask==3.0.3
|
||||
gunicorn==21.2.0
|
||||
Reference in New Issue
Block a user