diff --git a/docker-compose.yml b/docker-compose.yml index fdab1416..7f1543fe 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -290,6 +290,9 @@ services: - INSTALL_CASSANDRA=${PHP_FPM_INSTALL_CASSANDRA} - INSTALL_PHPREDIS=${LARAVEL_HORIZON_INSTALL_PHPREDIS} - INSTALL_MONGO=${LARAVEL_HORIZON_INSTALL_MONGO} + - 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 diff --git a/env-example b/env-example index c521fd04..feecbd65 100644 --- a/env-example +++ b/env-example @@ -253,6 +253,7 @@ NGINX_SSL_PATH=./nginx/ssl/ LARAVEL_HORIZON_INSTALL_SOCKETS=false LARAVEL_HORIZON_INSTALL_PHPREDIS=true LARAVEL_HORIZON_INSTALL_MONGO=false +LARAVEL_HORIZON_INSTALL_FFMPEG=false ### APACHE ################################################ diff --git a/laravel-horizon/Dockerfile b/laravel-horizon/Dockerfile index 4e9d3ef3..05a8ef24 100644 --- a/laravel-horizon/Dockerfile +++ b/laravel-horizon/Dockerfile @@ -35,6 +35,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 \ @@ -69,6 +78,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 \ diff --git a/laravel-horizon/supervisord.d/laravel-horizon.conf.example b/laravel-horizon/supervisord.d/laravel-horizon.conf.example index 245dccd5..f664320a 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