From be2ba79dc24cbdae1b7fd6413c6bc419cd1ff8ac Mon Sep 17 00:00:00 2001 From: Christian Winther Date: Wed, 17 Jan 2024 14:25:31 +0000 Subject: [PATCH] bugfixes --- .env.docker | 9 +++++++++ docker-compose.yml | 2 +- .../shared/root/docker/entrypoint.d/00-check-config.sh | 3 --- docker/shared/root/docker/entrypoint.d/12-migrations.sh | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.env.docker b/.env.docker index e7f259f2e..d2578d1be 100644 --- a/.env.docker +++ b/.env.docker @@ -995,6 +995,15 @@ DOCKER_APP_CACHE_PATH="${DOCKER_DATA_ROOT}/pixelfed/cache" # Port that Redis will listen on *outside* the container (e.g. the host machine) DOCKER_REDIS_PORT_EXTERNAL="${REDIS_PORT:-6379}" +# The filename that Redis should store its config file within +# +# NOTE: The file *MUST* exists (even empty) before enabling this setting! +# +# Use a command like [touch "${DOCKER_CONFIG_ROOT}/redis/redis.conf"] to create it. +# +# Defaults to "" +#DOCKER_REDIS_CONFIG_FILE="/etc/redis/redis.conf" + # Port that the database will listen on *outside* the container (e.g. the host machine) # # Use "3306" for MySQL/MariaDB and "5432" for PostgreeSQL diff --git a/docker-compose.yml b/docker-compose.yml index b85118411..02024c390 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -131,7 +131,7 @@ services: image: redis:7.2 container_name: "${DOCKER_CONTAINER_NAME_PREFIX}-redis" restart: unless-stopped - command: ["/etc/redis/redis.conf", "--requirepass", "${REDIS_PASSWORD:-}"] + command: "${DOCKER_REDIS_CONFIG_FILE} --requirepass '${REDIS_PASSWORD:-}'" environment: - REDISCLI_AUTH=${REDIS_PASSWORD:-} env_file: diff --git a/docker/shared/root/docker/entrypoint.d/00-check-config.sh b/docker/shared/root/docker/entrypoint.d/00-check-config.sh index 290deb3fc..eecb150b4 100755 --- a/docker/shared/root/docker/entrypoint.d/00-check-config.sh +++ b/docker/shared/root/docker/entrypoint.d/00-check-config.sh @@ -16,6 +16,3 @@ for file in "${dot_env_files[@]}"; do log-info "Linting dotenv file ${file}" dotenv-linter --skip=QuoteCharacter --skip=UnorderedKey "${file}" done - -# Write the config cache -run-as-runtime-user php artisan config:cache diff --git a/docker/shared/root/docker/entrypoint.d/12-migrations.sh b/docker/shared/root/docker/entrypoint.d/12-migrations.sh index 1fb49f393..41c27e986 100755 --- a/docker/shared/root/docker/entrypoint.d/12-migrations.sh +++ b/docker/shared/root/docker/entrypoint.d/12-migrations.sh @@ -14,7 +14,7 @@ await-database-ready # Detect if we have new migrations declare -i new_migrations=0 -run-as-runtime-user php artisan migrate:status | grep No && new_migrations=1 +(run-as-runtime-user php artisan migrate:status || :) | grep No && new_migrations=1 if is-true "${new_migrations}"; then log-info "No outstanding migrations detected"