Implement auto-generation of ecosystem.config.js and improve container setup
- Add automatic ecosystem.config.js generation from package.json - Create app directory automatically if missing - Copy simple-website example when app directory is empty - Remove redundant default app files from configs/ - Add HAProxy support with proper real IP forwarding - Configure nginx to trust proxy headers from private networks - Simplify entrypoint logic - always use /home/$user/app This makes the container more user-friendly by eliminating the need for manual PM2 configuration and ensuring the server always has a working app. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
10
README.md
10
README.md
@@ -81,7 +81,7 @@ Your Node.js application needs just two files to get started:
|
||||
|
||||
**Optional Files:**
|
||||
- `public/` folder for static files (HTML, CSS, images)
|
||||
- `ecosystem.config.js` for advanced PM2 configuration
|
||||
- `ecosystem.config.js` for advanced PM2 configuration (auto-generated if not provided)
|
||||
|
||||
### Step 2: What Users Need to Do
|
||||
|
||||
@@ -134,10 +134,18 @@ app.listen(port, () => {
|
||||
|
||||
**That's it!** The container will:
|
||||
- Install your dependencies automatically
|
||||
- Generate PM2 configuration from your package.json
|
||||
- Start your application with PM2
|
||||
- Handle SSL and reverse proxy
|
||||
- Provide health monitoring
|
||||
|
||||
#### Important package.json fields:
|
||||
- **name**: Used as the PM2 process name (defaults to 'node-app')
|
||||
- **main**: Entry point file (defaults to 'index.js')
|
||||
- **scripts.start**: Alternative way to specify entry point (e.g., "node server.js")
|
||||
|
||||
The container automatically generates an ecosystem.config.js file from your package.json if you don't provide one.
|
||||
|
||||
### Step 3: Example Applications
|
||||
|
||||
See the `examples/` directory for complete working examples:
|
||||
|
Reference in New Issue
Block a user