diff --git a/Dockerfile b/Dockerfile index fd3640a..042d0bb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,6 +52,7 @@ RUN apk update \ && mkdir /public COPY start.sh $WORKDIR COPY serve.json $WORKDIR +COPY pm2.config.js $WORKDIR RUN chmod +x "$START_SCRIPT" \ && apk del git curl \ && rm -rf /var/cache/apk/* diff --git a/README.md b/README.md index b6e6477..9f755cf 100644 --- a/README.md +++ b/README.md @@ -207,4 +207,6 @@ Sometimes a new version of this image will be bound to the same source commit. T - 1.0.57 [03-25-2025](https://github.com/iptv-org/epg/commit/138842009bb3f9135430cdc667502ffa51d4a295) - 1.0.58 - [04-04-2025](https://github.com/iptv-org/epg/commit/4df25c92bcad1e4892640f532eae71cf9f5e7b95) \ No newline at end of file + [04-04-2025](https://github.com/iptv-org/epg/commit/4df25c92bcad1e4892640f532eae71cf9f5e7b95) +- 1.0.59 + [04-04-2025](https://github.com/iptv-org/epg/commit/4df25c92bcad1e4892640f532eae71cf9f5e7b95)
Includes fixes for new configuration changes \ No newline at end of file diff --git a/pm2.config.js b/pm2.config.js new file mode 100644 index 0000000..395ab49 --- /dev/null +++ b/pm2.config.js @@ -0,0 +1,23 @@ +module.exports = { + apps: [ + { + name: 'serve', + script: 'npx serve -- public', + instances: 1, + watch: false, + autorestart: true + }, + { + name: 'grab', + script: process.env.SITE + ? `npm run grab -- --site=${process.env.SITE} ${ + process.env.CLANG ? `--lang=${process.env.CLANG}` : '' + } --output=public/guide.xml` + : `npm run grab -- --gzip --channels=channels.xml --output=public/guide.xml`, + cron_restart: process.env.CRON || null, + instances: 1, + watch: false, + autorestart: false + } + ] + } \ No newline at end of file diff --git a/start.sh b/start.sh index dbd2884..fa2470e 100644 --- a/start.sh +++ b/start.sh @@ -8,7 +8,7 @@ for arg in "$@"; do days=*) days="${arg#*=}" ;; max_connections=*) max_connections="${arg#*=}" ;; enable_fixes=*) enable_fixes="${arg#*=}" ;; - api_url=*) api_url="${arg#*=}" ;; + api_url=*) api_url="${arg#*=}" ;; esac done @@ -25,9 +25,6 @@ if [ "$enable_fixes" = true ] ; then fi sed -i -E "s/(https:\x2f\x2fiptv-org.github.io\x2fapi$\123filename\125)/$api_url$\123filename\125/g" $work_dir/scripts/core/apiClient.ts - -pm2 --name epg start npm -- run serve -npm run grab --- --channels=channels.xml --maxConnections=$max_connections --days=$days --gzip ln -s $work_dir/guide.xml /public/guide.xml ln -s $work_dir/guide.xml.gz /public/guide.xml.gz -npm run grab --- --channels=channels.xml --cron="$chron_schedule" --maxConnections=$max_connections --days=$days --gzip \ No newline at end of file +pm2-runtime pm2.config.js --name epg --node-args="--no-autorestart --cron-restart="$chron_schedule" --maxConnections=$max_connections --days=$days" \ No newline at end of file