Skip to content

devcontainer: Replace background & processes with pm2#59

Merged
Lastorder-DC merged 2 commits into
legacyfrom
copilot/update-poststartcommand-usage
Mar 20, 2026
Merged

devcontainer: Replace background & processes with pm2#59
Lastorder-DC merged 2 commits into
legacyfrom
copilot/update-poststartcommand-usage

Conversation

Copilot AI commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

postStartCommand was launching both servers with & backgrounding, which is unreliable in devcontainer lifecycle hooks and leaves processes unmanaged (no restart-on-crash, no logging).

Changes

  • ecosystem.config.js (new): pm2 app definitions for two processes:

    • http-server — serves static files on port 5500 via locally installed binary
    • dev-server — runs server/index.js --dev
  • .devcontainer/devcontainer.json:

    • postCreateCommand: installs pm2 globally + root deps + server deps
    • postStartCommand: pm2 start ecosystem.config.js
  • package.json: adds http-server ^14.1.1 as a devDependency (replaces one-off npx -y download on each start)

// Before
"postStartCommand": "npx -y http-server -p 5500 -c-1 . & node server/index.js --dev &"

// After
"postCreateCommand": "npm install -g pm2 && npm install && cd server && npm install",
"postStartCommand": "pm2 start ecosystem.config.js"

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@vercel

vercel Bot commented Mar 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chatassistx Ready Ready Preview, Comment Mar 20, 2026 9:03am

Co-authored-by: Lastorder-DC <18280396+Lastorder-DC@users.noreply.github.com>
Copilot AI changed the title [WIP] Update postStartCommand for process management devcontainer: Replace background & processes with pm2 Mar 20, 2026
Copilot AI requested a review from Lastorder-DC March 20, 2026 09:04
@Lastorder-DC Lastorder-DC marked this pull request as ready for review March 20, 2026 11:45
@Lastorder-DC Lastorder-DC merged commit a6ffde2 into legacy Mar 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants