From e50c21440f12b656be31ddd48f54dd935477e66f Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 4 Jun 2023 09:07:41 +0200 Subject: [PATCH] Define default values for env vars used in rr prod config --- CHANGELOG.md | 1 + config/roadrunner/.rr.yml | 6 +++--- docker/docker-entrypoint.sh | 8 -------- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91fd6070d..4df74b5a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this ### Fixed * [#1413](https://github.com/shlinkio/shlink/issues/1413) Fix error when creating initial DB in Postgres in a cluster where a default `postgres` db does not exist or the credentials do not grant permissions to connect. +* [#1803](https://github.com/shlinkio/shlink/issues/1803) Fix default RoadRunner port when not using docker image. ## [3.6.0] - 2023-05-24 diff --git a/config/roadrunner/.rr.yml b/config/roadrunner/.rr.yml index 8d1344d71..b6783c289 100644 --- a/config/roadrunner/.rr.yml +++ b/config/roadrunner/.rr.yml @@ -7,18 +7,18 @@ server: command: 'php -dopcache.enable_cli=1 -dopcache.validate_timestamps=0 ../../bin/roadrunner-worker.php' http: - address: '0.0.0.0:${PORT}' + address: '0.0.0.0:${PORT:-8080}' middleware: ['static'] static: dir: '../../public' forbid: ['.php', '.htaccess'] pool: - num_workers: ${WEB_WORKER_NUM} + num_workers: ${WEB_WORKER_NUM:-0} jobs: timeout: 300 # 5 minutes pool: - num_workers: ${TASK_WORKER_NUM} + num_workers: ${TASK_WORKER_NUM:-0} consume: ['shlink'] pipelines: shlink: diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index a2daec3db..2058c44ce 100644 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -20,14 +20,6 @@ if [ "${ENABLE_PERIODIC_VISIT_LOCATE}" = "true" ] && [ "${SHLINK_USER_ID}" = "ro /usr/sbin/crond & fi -# RoadRunner config needs these to have been set, so falling back to default values if not set yet -if [ "$SHLINK_RUNTIME" == 'rr' ]; then - export PORT="${PORT:-"8080"}" - # Default to 0 so that RoadRunner decides the number of workers based on the amount of logical CPUs - export WEB_WORKER_NUM="${WEB_WORKER_NUM:-"0"}" - export TASK_WORKER_NUM="${TASK_WORKER_NUM:-"0"}" -fi - if [ "$SHLINK_RUNTIME" == 'openswoole' ]; then # When restarting the container, openswoole might think it is already in execution # This forces the app to be started every second until the exit code is 0