← back to Homesonspec
pm2: boot spechomes-workers via node --env-file so DATABASE_URL loads
844edb3a73d819168e7def3a64b281998fa6b478 · 2026-07-23 13:33:33 -0700 · Steve Abrams
Files touched
Diff
commit 844edb3a73d819168e7def3a64b281998fa6b478
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Thu Jul 23 13:33:33 2026 -0700
pm2: boot spechomes-workers via node --env-file so DATABASE_URL loads
---
ecosystem.config.js | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/ecosystem.config.js b/ecosystem.config.js
index 30181a2..143c3fd 100644
--- a/ecosystem.config.js
+++ b/ecosystem.config.js
@@ -16,10 +16,14 @@ module.exports = {
env: { NODE_ENV: "production", PORT: "3101" },
},
{
+ // tsx-run daemon (pg-boss queue consumer). Unlike the Next apps it does
+ // not auto-load .env, so load the (gitignored) root .env via node's
+ // --env-file — keeps DATABASE_URL out of this committed file.
name: "spechomes-workers",
- cwd: __dirname,
- script: "pnpm",
- args: "--filter @spechomes/workers start",
+ cwd: __dirname + "/apps/workers",
+ script: "src/index.ts",
+ interpreter: "node",
+ interpreter_args: "--env-file=" + __dirname + "/.env --import tsx",
env: { NODE_ENV: "production" },
},
],
← ff4a50f chore: gitignore screenrecord/ test artifacts
·
back to Homesonspec
·
add pnpm redeploy scripts (build + pm2 restart) for prod web b04f2be →