All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 3m53s
- Updated Gitea workflows to standardize on `DB_NAME` instead of `DB_DATABASE` for database name references. - Modified deployment, backup, reset, and restore workflows to ensure consistent environment variable usage. - Removed dotenv dependency and preload script, transitioning to environment variable management directly in scripts. - Adjusted application code to utilize `DB_NAME` for database connections and logging. - Enhanced README to reflect changes in environment variable configuration and usage. - Cleaned up package.json scripts to remove unnecessary preload references.
39 lines
1.5 KiB
JavaScript
39 lines
1.5 KiB
JavaScript
// ecosystem.config.cjs
|
|
// This file is the standard way to configure applications for PM2.
|
|
// It allows us to define all the settings for our application in one place.
|
|
// The .cjs extension is required because the project's package.json has "type": "module".
|
|
|
|
module.exports = {
|
|
apps: [
|
|
{
|
|
name: 'flyer-crawler-api', // The name of our API application in PM2
|
|
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',
|
|
env_production: {
|
|
NODE_ENV: 'production', // Set the Node.js environment to production
|
|
},
|
|
},
|
|
{
|
|
name: 'flyer-crawler-worker', // The name of our worker process in PM2
|
|
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',
|
|
env_production: {
|
|
NODE_ENV: 'production',
|
|
},
|
|
},
|
|
{
|
|
name: 'flyer-crawler-analytics-worker', // A dedicated worker for analytics
|
|
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',
|
|
env_production: {
|
|
NODE_ENV: 'production',
|
|
},
|
|
},
|
|
],
|
|
}; |