feat: add maintenance middleware and HTML page for downtime notifications
This commit is contained in:
parent
6d41ff4520
commit
278acb132a
2 changed files with 103 additions and 0 deletions
|
|
@ -189,6 +189,8 @@ services:
|
||||||
- "traefik.http.routers.info.service=info"
|
- "traefik.http.routers.info.service=info"
|
||||||
- "traefik.http.routers.info.tls.certresolver=letsencrypt"
|
- "traefik.http.routers.info.tls.certresolver=letsencrypt"
|
||||||
- "traefik.http.services.info.loadbalancer.server.port=3000"
|
- "traefik.http.services.info.loadbalancer.server.port=3000"
|
||||||
|
# MAINTENANCE MIDDLEWARE
|
||||||
|
- "traefik.http.routers.myapp.middlewares=catch-maintenance@docker"
|
||||||
depends_on:
|
depends_on:
|
||||||
backend:
|
backend:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
@ -198,6 +200,20 @@ services:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
tiles:
|
tiles:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
maintenance-page:
|
||||||
|
image: nginx:alpine
|
||||||
|
restart: always
|
||||||
|
# You can create a folder in your Dokploy project for the HTML
|
||||||
|
volumes:
|
||||||
|
- ./maintenance:/usr/share/nginx/html:ro
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.http.routers.maint.rule=Host(`${DOMAIN}`)"
|
||||||
|
- "traefik.http.routers.maint.priority=1"
|
||||||
|
|
||||||
|
- "traefik.http.middlewares.catch-maintenance.errors.status=502-504"
|
||||||
|
- "traefik.http.middlewares.catch-maintenance.errors.service=maintenance-page"
|
||||||
|
- "traefik.http.middlewares.catch-maintenance.errors.query=/maintenance.html"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
dokploy-network:
|
dokploy-network:
|
||||||
|
|
|
||||||
87
maintenance/maintenance.html
Normal file
87
maintenance/maintenance.html
Normal file
|
|
@ -0,0 +1,87 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="it">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title>Manutenzione in corso – InfoAlloggi</title>
|
||||||
|
<style>
|
||||||
|
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||||
|
background: #f5f5f5;
|
||||||
|
color: #333;
|
||||||
|
min-height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 16px;
|
||||||
|
box-shadow: 0 4px 24px rgba(0,0,0,0.08);
|
||||||
|
max-width: 520px;
|
||||||
|
width: 100%;
|
||||||
|
padding: 3rem 2.5rem;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
font-size: 3.5rem;
|
||||||
|
margin-bottom: 1.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 1.75rem;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #1a1a1a;
|
||||||
|
margin-bottom: 0.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
font-size: 1rem;
|
||||||
|
line-height: 1.6;
|
||||||
|
color: #555;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.divider {
|
||||||
|
border: none;
|
||||||
|
border-top: 1px solid #eee;
|
||||||
|
margin: 1.75rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
font-size: 0.85rem;
|
||||||
|
color: #999;
|
||||||
|
margin-top: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer a {
|
||||||
|
color: #4a90e2;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="card">
|
||||||
|
<div class="icon">🔧</div>
|
||||||
|
<h1>Sito in manutenzione</h1>
|
||||||
|
<p>Stiamo effettuando degli aggiornamenti per migliorare il servizio.</p>
|
||||||
|
<p>Torneremo online a breve.</p>
|
||||||
|
<hr class="divider" />
|
||||||
|
<p>Ci scusiamo per il disagio e ti ringraziamo per la pazienza.</p>
|
||||||
|
</div>
|
||||||
|
<p class="footer">
|
||||||
|
Per assistenza urgente contattaci all'indirizzo
|
||||||
|
<a href="mailto:info@infoalloggi.it">info@infoalloggi.it</a>
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
Add table
Reference in a new issue