From 754e61d15f196ef7e016f3801d44b71686531ee2 Mon Sep 17 00:00:00 2001 From: Claudio Ludovico <921500+ludo237@users.noreply.github.com> Date: Wed, 4 Dec 2019 11:36:47 +0000 Subject: [PATCH 1/6] Add key to install ffmpeg in horizon --- env-example | 1 + 1 file changed, 1 insertion(+) diff --git a/env-example b/env-example index a52f36e..120c36e 100644 --- a/env-example +++ b/env-example @@ -237,6 +237,7 @@ NGINX_SSL_PATH=./nginx/ssl/ LARAVEL_HORIZON_INSTALL_SOCKETS=false LARAVEL_HORIZON_INSTALL_PHPREDIS=true +LARAVEL_HORIZON_INSTALL_FFMPEG=false ### APACHE ################################################ From c11c1fd69d902553d0360504798e87a92b065e28 Mon Sep 17 00:00:00 2001 From: Claudio Ludovico <921500+ludo237@users.noreply.github.com> Date: Wed, 4 Dec 2019 11:38:36 +0000 Subject: [PATCH 2/6] Add ffmpeg directive to Dockerfile --- laravel-horizon/Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/laravel-horizon/Dockerfile b/laravel-horizon/Dockerfile index 5ce1d8e..3c0509e 100644 --- a/laravel-horizon/Dockerfile +++ b/laravel-horizon/Dockerfile @@ -60,6 +60,12 @@ RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ && docker-php-ext-enable redis \ ;fi +ARG INSTALL_FFMPEG=false +RUN if [ ${INSTALL_FFMPEG} = true ]; then \ + # Add ffmpeg to horizon + apk add ffmpeg \ +;fi + WORKDIR /usr/src RUN if [ ${INSTALL_CASSANDRA} = true ]; then \ git clone https://github.com/datastax/php-driver.git \ From d40abcb939a0f35161911dedb1e2d6e4880d8e93 Mon Sep 17 00:00:00 2001 From: Claudio Ludovico <921500+ludo237@users.noreply.github.com> Date: Wed, 4 Dec 2019 11:40:04 +0000 Subject: [PATCH 3/6] Add arg to laravel-horizon service --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index 4f32e05..d3aca5a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -271,6 +271,7 @@ services: - INSTALL_SOCKETS=${LARAVEL_HORIZON_INSTALL_SOCKETS} - INSTALL_CASSANDRA=${PHP_FPM_INSTALL_CASSANDRA} - INSTALL_PHPREDIS=${LARAVEL_HORIZON_INSTALL_PHPREDIS} + - INSTALL_FFMPEG=${LARAVEL_HORIZON_INSTALL_FFMPEG} volumes: - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER} - ./laravel-horizon/supervisord.d:/etc/supervisord.d From 4fbe5c03b972fedbe9e36df090cc12beb48c1e77 Mon Sep 17 00:00:00 2001 From: Claudio Ludovico <921500+ludo237@users.noreply.github.com> Date: Tue, 14 Jan 2020 16:06:25 +0100 Subject: [PATCH 4/6] Update Dockerfile Add non-root user for ffmpeg installation --- laravel-horizon/Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/laravel-horizon/Dockerfile b/laravel-horizon/Dockerfile index 3c0509e..f627557 100644 --- a/laravel-horizon/Dockerfile +++ b/laravel-horizon/Dockerfile @@ -26,6 +26,15 @@ RUN apk --update add wget \ RUN docker-php-ext-install mysqli mbstring pdo pdo_mysql tokenizer xml pcntl RUN pecl channel-update pecl.php.net && pecl install memcached mcrypt-1.0.1 mongodb && docker-php-ext-enable memcached mongodb +# Add a non-root user to help install ffmpeg: +ARG PUID=1000 +ENV PUID ${PUID} +ARG PGID=1000 +ENV PGID ${PGID} + +RUN addgroup -g ${PGID} laradock && \ + adduser -D -G laradock -u ${PUID} laradock + #Install BCMath package: ARG INSTALL_BCMATH=false RUN if [ ${INSTALL_BCMATH} = true ]; then \ From a84611ff4b117dfa0c5ee52ec3ca0a7141120f34 Mon Sep 17 00:00:00 2001 From: Claudio Ludovico <921500+ludo237@users.noreply.github.com> Date: Tue, 14 Jan 2020 16:07:07 +0100 Subject: [PATCH 5/6] Update docker-compose.yml Add necessary args --- docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index d3aca5a..22d96b6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -272,6 +272,8 @@ services: - INSTALL_CASSANDRA=${PHP_FPM_INSTALL_CASSANDRA} - INSTALL_PHPREDIS=${LARAVEL_HORIZON_INSTALL_PHPREDIS} - INSTALL_FFMPEG=${LARAVEL_HORIZON_INSTALL_FFMPEG} + - PUID=${PHP_WORKER_PUID} + - PGID=${PHP_WORKER_PGID} volumes: - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER} - ./laravel-horizon/supervisord.d:/etc/supervisord.d From 84b5c5aaa00b623fbbcc20acf45c9247e3083999 Mon Sep 17 00:00:00 2001 From: Claudio Ludovico <921500+ludo237@users.noreply.github.com> Date: Tue, 14 Jan 2020 16:10:42 +0100 Subject: [PATCH 6/6] Update config Add user created during docker installation --- laravel-horizon/supervisord.d/laravel-horizon.conf.example | 1 + 1 file changed, 1 insertion(+) diff --git a/laravel-horizon/supervisord.d/laravel-horizon.conf.example b/laravel-horizon/supervisord.d/laravel-horizon.conf.example index 245dccd..f664320 100644 --- a/laravel-horizon/supervisord.d/laravel-horizon.conf.example +++ b/laravel-horizon/supervisord.d/laravel-horizon.conf.example @@ -1,5 +1,6 @@ [program:laravel-horizon] process_name=%(program_name)s_%(process_num)02d +user=laradock command=php /var/www/artisan horizon autostart=true autorestart=true