deploy changes to test and production environments
Some checks failed
Some checks failed
This commit is contained in:
@@ -6,33 +6,60 @@
|
||||
module.exports = {
|
||||
apps: [
|
||||
{
|
||||
name: 'flyer-crawler-api', // The name of our API application in PM2
|
||||
// --- API Server ---
|
||||
// The name is now dynamically set based on the environment.
|
||||
// This is a common pattern but requires you to call pm2 with the correct name.
|
||||
// The deploy script handles this by using 'flyer-crawler-api' for prod and 'flyer-crawler-api-test' for test.
|
||||
name: 'flyer-crawler-api',
|
||||
script: './node_modules/.bin/tsx',
|
||||
args: 'server.ts', // tsx will execute this file
|
||||
// Explicitly set the working directory. This is crucial for reliability.
|
||||
cwd: '/var/www/flyer-crawler.projectium.com',
|
||||
// Production Environment Settings
|
||||
env_production: {
|
||||
NODE_ENV: 'production', // Set the Node.js environment to production
|
||||
name: 'flyer-crawler-api',
|
||||
cwd: '/var/www/flyer-crawler.projectium.com',
|
||||
},
|
||||
// Test Environment Settings
|
||||
env_test: {
|
||||
NODE_ENV: 'development', // Use 'development' for test to enable more verbose logging if needed
|
||||
name: 'flyer-crawler-api-test',
|
||||
cwd: '/var/www/flyer-crawler-test.projectium.com',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'flyer-crawler-worker', // The name of our worker process in PM2
|
||||
// --- General Worker ---
|
||||
name: 'flyer-crawler-worker',
|
||||
script: './node_modules/.bin/tsx',
|
||||
args: 'src/services/queueService.server.ts', // tsx will execute this file
|
||||
// Explicitly set the working directory.
|
||||
cwd: '/var/www/flyer-crawler.projectium.com',
|
||||
// Production Environment Settings
|
||||
env_production: {
|
||||
NODE_ENV: 'production',
|
||||
name: 'flyer-crawler-worker',
|
||||
cwd: '/var/www/flyer-crawler.projectium.com',
|
||||
},
|
||||
// Test Environment Settings
|
||||
env_test: {
|
||||
NODE_ENV: 'development',
|
||||
name: 'flyer-crawler-worker-test',
|
||||
cwd: '/var/www/flyer-crawler-test.projectium.com',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'flyer-crawler-analytics-worker', // A dedicated worker for analytics
|
||||
// --- Analytics Worker ---
|
||||
name: 'flyer-crawler-analytics-worker',
|
||||
script: './node_modules/.bin/tsx',
|
||||
// Point to the main worker service file. It will start all workers.
|
||||
args: 'src/services/queueService.server.ts', // tsx will execute this file
|
||||
cwd: '/var/www/flyer-crawler.projectium.com',
|
||||
// Production Environment Settings
|
||||
env_production: {
|
||||
NODE_ENV: 'production',
|
||||
name: 'flyer-crawler-analytics-worker',
|
||||
cwd: '/var/www/flyer-crawler.projectium.com',
|
||||
},
|
||||
// Test Environment Settings
|
||||
env_test: {
|
||||
NODE_ENV: 'development',
|
||||
name: 'flyer-crawler-analytics-worker-test',
|
||||
cwd: '/var/www/flyer-crawler-test.projectium.com',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user