|
| 1 | +const logsDir = process.cwd() + 'tmp/logs' |
| 2 | + |
| 3 | +const sharedEnv = { |
| 4 | + NODE_ENV: 'production', |
| 5 | + |
| 6 | + GRAPHQL_PORT: 5000, |
| 7 | + |
| 8 | + SCRAPER_PORT: 5001, |
| 9 | + |
| 10 | + // The name of the MongoDB database |
| 11 | + MONGO_DATABASE: 'popcorn-api', |
| 12 | + |
| 13 | + // The URI to the MongoDB database. |
| 14 | + MONGO_URI: '127.0.0.1', |
| 15 | + |
| 16 | + // The port of the MongoDB database. |
| 17 | + MONGO_PORT: '27017', |
| 18 | + |
| 19 | + // The username of the MongoDB database, disable if none. |
| 20 | + // MONGO_USER: '', |
| 21 | + |
| 22 | + // The password of the MongoDB database, disable if none. |
| 23 | + // MONGO_PASS: '', |
| 24 | + |
| 25 | + // Location where to download everything in, make sure this location exists |
| 26 | + // Also must be a absolute path |
| 27 | + DOWNLOAD_LOCATION: '', |
| 28 | + |
| 29 | + // Username of your opensubtitles account |
| 30 | + // OPENSUBTITLES_USERNAME: '', |
| 31 | + |
| 32 | + // Password of your opensubtitles account |
| 33 | + // OPENSUBTITLES_PASSWORD: '', |
| 34 | + |
| 35 | + // API key for Fanart, get one here: https://fanart.tv/get-an-api-key/ |
| 36 | + FANART_KEY: '', |
| 37 | + |
| 38 | + // API key for Omdb, get one here: http://www.omdbapi.com/apikey.aspx |
| 39 | + OMDB_KEY: '', |
| 40 | + |
| 41 | + // API key for Tmdb, get one here: https://www.themoviedb.org/settings/api/new/form?type=developer |
| 42 | + TMDB_KEY: '', |
| 43 | + |
| 44 | + // API key for Trakt, get one here: https://trakt.tv/oauth/applications/new (Use the client id) |
| 45 | + TRAKT_KEY: '', |
| 46 | + |
| 47 | + // API key for Tvdb, get one here: https://www.thetvdb.com/member/api |
| 48 | + TVDB_KEY: '', |
| 49 | +} |
| 50 | + |
| 51 | +module.exports = { |
| 52 | + apps: [ |
| 53 | + { |
| 54 | + name: 'GraphQL API', |
| 55 | + script: 'dist/apps/graphql-api/main.js', |
| 56 | + instances: 1, |
| 57 | + max_restarts: 5, |
| 58 | + autorestart: true, |
| 59 | + watch: false, |
| 60 | + error_file: `${logsDir}/graphql-api/error.log`, |
| 61 | + out_file: `${logsDir}/graphql-api/out.log`, |
| 62 | + log_file: null, |
| 63 | + env: sharedEnv |
| 64 | + }, |
| 65 | + { |
| 66 | + name: 'Scraper', |
| 67 | + script: 'dist/apps/scraper/main.js', |
| 68 | + args: '-m pretty', |
| 69 | + instances: 1, |
| 70 | + max_restarts: 5, |
| 71 | + autorestart: true, |
| 72 | + watch: false, |
| 73 | + error_file: `${logsDir}/scraper/error.log`, |
| 74 | + out_file: `${logsDir}/scraper/out.log`, |
| 75 | + log_file: null, |
| 76 | + env: { |
| 77 | + ...sharedEnv, |
| 78 | + |
| 79 | + // The time between cronjobs. |
| 80 | + CRON_TIME: '0 0 */6 * * *', |
| 81 | + |
| 82 | + // The location of the temporary directory for the logs. |
| 83 | + TEMP_DIR: `${logsDir}/`, |
| 84 | + }, |
| 85 | + }, |
| 86 | + // Enable this if you want auto updates |
| 87 | + // { |
| 88 | + // name: 'Updater', |
| 89 | + // cwd: 'updater', |
| 90 | + // script: 'dist/updater.js', |
| 91 | + // instances: 1, |
| 92 | + // max_restarts: 5, |
| 93 | + // autorestart: true, |
| 94 | + // watch: false, |
| 95 | + // error_file: `${logsDir}/updater.log`, |
| 96 | + // out_file: `${logsDir}/updater.log`, |
| 97 | + // log_file: null, |
| 98 | + // env: { |
| 99 | + // // The time between cronjobs. |
| 100 | + // CRON_TIME: '0 0 * * *', |
| 101 | + // }, |
| 102 | + // }, |
| 103 | + ], |
| 104 | +} |
0 commit comments