feat: container health-check

This commit is contained in:
Dawson 2025-06-20 01:37:19 -05:00
parent a5799cb22d
commit e459a7d9e3
2 changed files with 11 additions and 0 deletions

View File

@ -14,5 +14,8 @@ COPY --from=builder /app .
# Expose port
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s CMD wget -qO- http://localhost:3000/health || exit 1
# Start the application
CMD ["npm", "start"]

View File

@ -414,6 +414,14 @@ app.get('/managers/toast', (req, res) => {
res.sendFile(path.join(PUBLIC_DIR, 'managers', 'toast.js'));
});
app.get('/health', (_req, res) => {
res.json({
status: 'ok',
timestamp: new Date().toISOString(),
uptime: process.uptime()
});
});
app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'index.html'));
});