← back to Homesonspec

ecosystem.config.js

31 lines

// pm2 process definitions. Production start assumes `pnpm build` has run.
module.exports = {
  apps: [
    {
      name: "homesonspec-web",
      cwd: __dirname,
      script: "pnpm",
      args: "--filter @homesonspec/web start",
      env: { NODE_ENV: "production", PORT: "3100" },
    },
    {
      name: "homesonspec-admin",
      cwd: __dirname,
      script: "pnpm",
      args: "--filter @homesonspec/admin start",
      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: "homesonspec-workers",
      cwd: __dirname + "/apps/workers",
      script: "src/index.ts",
      interpreter: "node",
      interpreter_args: "--env-file=" + __dirname + "/.env --import tsx",
      env: { NODE_ENV: "production" },
    },
  ],
};