mirror of
https://github.com/DumbWareio/DumbDrop.git
synced 2025-10-23 07:41:58 +00:00
feat(docker): Added a health check endpoint to ensure the application is running properly, enhancing reliability in deployment.
This commit is contained in:
@@ -14,13 +14,18 @@ services:
|
||||
DUMBDROP_PIN: 123456 # Optional PIN protection (4-10 digits, leave empty to disable)
|
||||
AUTO_UPLOAD: true # Upload without clicking button
|
||||
BASE_URL: http://localhost:3000 # The base URL for the application
|
||||
|
||||
|
||||
# Additional available environment variables (commented out with defaults)
|
||||
# FOOTER_LINKS: "My Site @ https://example.com,Docs @ https://docs.example.com" # Custom footer links
|
||||
# PORT: 3000 # Server port (default: 3000)
|
||||
# NODE_ENV: production # Node environment (development/production)
|
||||
# DEBUG: false # Debug mode for verbose logging (default: false in production, true in development)
|
||||
# APPRISE_URL: "" # Apprise notification URL for upload notifications (default: none)
|
||||
# APPRISE_MESSAGE: "New file uploaded - {filename} ({size}), Storage used {storage}" # Notification message template with placeholders: {filename}, {size}, {storage}
|
||||
# APPRISE_SIZE_UNIT: "Auto" # Size unit for notifications (B, KB, MB, GB, TB, or Auto)
|
||||
# ALLOWED_EXTENSIONS: ".jpg,.jpeg,.png,.pdf,.doc,.docx,.txt" # Comma-separated list of allowed file extensions (default: all allowed)
|
||||
# ALLOWED_EXTENSIONS: ".jpg,.jpeg,.png,.pdf,.doc,.docx,.txt" # Comma-separated list of allowed file extensions (default: all allowed)
|
||||
# healthcheck:
|
||||
# test: ["CMD", "curl", "--fail", "http://localhost:3000/health"]
|
||||
# interval: 30s
|
||||
# timeout: 10s
|
||||
# retries: 3
|
||||
# start_period: 30s
|
@@ -136,6 +136,11 @@ app.get('/login.html', (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
// --- Health Check Endpoint ---
|
||||
app.get('/health', (req, res) => {
|
||||
res.status(200).json({ status: 'UP', message: 'Server is healthy' });
|
||||
});
|
||||
|
||||
// --- Static File Serving ---
|
||||
// Serve static files (CSS, JS, assets) from the 'public' directory
|
||||
// Use express.static middleware, placed AFTER specific HTML routes
|
||||
|
Reference in New Issue
Block a user