From 65f9a20d2042118915f3b08d0eae51701c444003 Mon Sep 17 00:00:00 2001 From: Stavros Kois Date: Tue, 27 Jan 2026 19:53:55 +0200 Subject: [PATCH 1/7] fix: replace double brackets with single brackets for POSIX compliance in koel-init --- koel-init | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/koel-init b/koel-init index f9b859c..404cef3 100755 --- a/koel-init +++ b/koel-init @@ -1,15 +1,15 @@ #!/bin/sh -if [[ ! -f /var/www/html/.env ]]; then +if [ ! -f /var/www/html/.env ]; then echo "No .env file found in /var/www/html. Make sure to mount a .env file to store the configuration. You can use the koel:init command (see https://github.com/koel/docker#the-koelinit-command) for a guided setup." echo "" echo "See https://github.com/koel/koel/blob/master/.env.example for an example .env file." exit 0 fi -if [[ -z "${SKIP_INIT}" ]]; then - if [[ -z "${OPTIMIZE_CONFIG}" ]]; then - echo "Config not optimized. You can optimize the config with `OPTIMIZE_CONFIG`. Note that this will prevent config modifications from being applied until the container is restarted." +if [ -z "${SKIP_INIT}" ]; then + if [ -z "${OPTIMIZE_CONFIG}" ]; then + echo "Config not optimized. You can optimize the config with 'OPTIMIZE_CONFIG'. Note that this will prevent config modifications from being applied until the container is restarted." else echo "Optimizing config..." # clear before caching, in case this is a container reboot and it was already cached from before @@ -22,4 +22,4 @@ if [[ -z "${SKIP_INIT}" ]]; then php artisan koel:init --no-assets --no-interaction else echo "Initialization skipped. koel might not work properly if it is misconfigured or if the database is out of date. This should not be used outside of debugging or manual initial setups!" -fi \ No newline at end of file +fi From e728ee5bf3e7624c288834fa5f5ffdbff3b647a6 Mon Sep 17 00:00:00 2001 From: Stavros Kois Date: Tue, 27 Jan 2026 19:54:05 +0200 Subject: [PATCH 2/7] fix: remove exit command to allow further initialization steps in koel-init --- koel-init | 1 - 1 file changed, 1 deletion(-) diff --git a/koel-init b/koel-init index 404cef3..3d9e78e 100755 --- a/koel-init +++ b/koel-init @@ -4,7 +4,6 @@ if [ ! -f /var/www/html/.env ]; then echo "No .env file found in /var/www/html. Make sure to mount a .env file to store the configuration. You can use the koel:init command (see https://github.com/koel/docker#the-koelinit-command) for a guided setup." echo "" echo "See https://github.com/koel/koel/blob/master/.env.example for an example .env file." - exit 0 fi if [ -z "${SKIP_INIT}" ]; then From b0353c8e8397fbc511f5ce11d5ac564871422dfe Mon Sep 17 00:00:00 2001 From: Stavros Kois Date: Tue, 27 Jan 2026 20:16:18 +0200 Subject: [PATCH 3/7] set the pph ini var, --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 331ee75..8518e28 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,8 @@ FROM alpine:3.23.2 # The koel version to download ARG KOEL_VERSION_REF=v8.3.0 +ENV PHP_INI_DIR=/usr/local/etc/php + # Install dependencies RUN apk add --no-cache --no-interactive \ curl \ @@ -67,7 +69,7 @@ COPY apache/httpd.conf /etc/apache2/ COPY apache/www.conf /etc/php84/php-fpm.d/ # Copy php.ini -COPY ./php.ini "$PHP_INI_DIR/php.ini" +COPY ./php.ini ${PHP_INI_DIR}/php.ini # make crontab file RUN touch /etc/crontabs/www-data From 5f0c21bafd7fb8f199646c7e4822d9ec76e93457 Mon Sep 17 00:00:00 2001 From: Stavros Kois Date: Tue, 27 Jan 2026 20:24:35 +0200 Subject: [PATCH 4/7] fix: create .env file during application setup in Dockerfile --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8518e28..cfcbd41 100644 --- a/Dockerfile +++ b/Dockerfile @@ -148,7 +148,8 @@ USER www-data RUN cd /var/www/html \ && php artisan route:cache \ && php artisan event:cache \ - && php artisan view:cache + && php artisan view:cache && \ + touch /var/www/html/.env ENV FFMPEG_PATH=/usr/bin/ffmpeg \ From 700d2e90c07940ccbd901f523ddcd53c5c5ab11f Mon Sep 17 00:00:00 2001 From: Stavros Kois Date: Tue, 27 Jan 2026 20:33:52 +0200 Subject: [PATCH 5/7] fix: remove .env file creation from Dockerfile and ensure it's created in koel-init --- Dockerfile | 3 +-- koel-init | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index cfcbd41..8518e28 100644 --- a/Dockerfile +++ b/Dockerfile @@ -148,8 +148,7 @@ USER www-data RUN cd /var/www/html \ && php artisan route:cache \ && php artisan event:cache \ - && php artisan view:cache && \ - touch /var/www/html/.env + && php artisan view:cache ENV FFMPEG_PATH=/usr/bin/ffmpeg \ diff --git a/koel-init b/koel-init index 3d9e78e..3771895 100755 --- a/koel-init +++ b/koel-init @@ -4,6 +4,7 @@ if [ ! -f /var/www/html/.env ]; then echo "No .env file found in /var/www/html. Make sure to mount a .env file to store the configuration. You can use the koel:init command (see https://github.com/koel/docker#the-koelinit-command) for a guided setup." echo "" echo "See https://github.com/koel/koel/blob/master/.env.example for an example .env file." + printenv > /var/www/html/.env fi if [ -z "${SKIP_INIT}" ]; then From 78591aa5a24a62f707acd15c0da5e7413c304cd9 Mon Sep 17 00:00:00 2001 From: Stavros Kois Date: Tue, 27 Jan 2026 20:47:11 +0200 Subject: [PATCH 6/7] revert --- koel-init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koel-init b/koel-init index 3771895..404cef3 100755 --- a/koel-init +++ b/koel-init @@ -4,7 +4,7 @@ if [ ! -f /var/www/html/.env ]; then echo "No .env file found in /var/www/html. Make sure to mount a .env file to store the configuration. You can use the koel:init command (see https://github.com/koel/docker#the-koelinit-command) for a guided setup." echo "" echo "See https://github.com/koel/koel/blob/master/.env.example for an example .env file." - printenv > /var/www/html/.env + exit 0 fi if [ -z "${SKIP_INIT}" ]; then From 5b7811a217e6271f9810b6237609bb0ead600cb6 Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Wed, 28 Jan 2026 11:09:33 +0200 Subject: [PATCH 7/7] Apply suggestion from @stavros-k --- koel-init | 1 - 1 file changed, 1 deletion(-) diff --git a/koel-init b/koel-init index 404cef3..3d9e78e 100755 --- a/koel-init +++ b/koel-init @@ -4,7 +4,6 @@ if [ ! -f /var/www/html/.env ]; then echo "No .env file found in /var/www/html. Make sure to mount a .env file to store the configuration. You can use the koel:init command (see https://github.com/koel/docker#the-koelinit-command) for a guided setup." echo "" echo "See https://github.com/koel/koel/blob/master/.env.example for an example .env file." - exit 0 fi if [ -z "${SKIP_INIT}" ]; then