Skip to content

Commit bb7ee22

Browse files
authored
Merge pull request laradock#2396 from ludo237/master
Add the ability to install ffmpeg on Laravel Horizon container
2 parents cd84c46 + 84b5c5a commit bb7ee22

4 files changed

Lines changed: 20 additions & 0 deletions

File tree

docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,9 @@ services:
290290
- INSTALL_CASSANDRA=${PHP_FPM_INSTALL_CASSANDRA}
291291
- INSTALL_PHPREDIS=${LARAVEL_HORIZON_INSTALL_PHPREDIS}
292292
- INSTALL_MONGO=${LARAVEL_HORIZON_INSTALL_MONGO}
293+
- INSTALL_FFMPEG=${LARAVEL_HORIZON_INSTALL_FFMPEG}
294+
- PUID=${PHP_WORKER_PUID}
295+
- PGID=${PHP_WORKER_PGID}
293296
volumes:
294297
- ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}
295298
- ./laravel-horizon/supervisord.d:/etc/supervisord.d

env-example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ NGINX_SSL_PATH=./nginx/ssl/
253253
LARAVEL_HORIZON_INSTALL_SOCKETS=false
254254
LARAVEL_HORIZON_INSTALL_PHPREDIS=true
255255
LARAVEL_HORIZON_INSTALL_MONGO=false
256+
LARAVEL_HORIZON_INSTALL_FFMPEG=false
256257

257258
### APACHE ################################################
258259

laravel-horizon/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ RUN apk --update add wget \
3535
RUN docker-php-ext-install mysqli mbstring pdo pdo_mysql tokenizer xml pcntl
3636
RUN pecl channel-update pecl.php.net && pecl install memcached mcrypt-1.0.1 mongodb && docker-php-ext-enable memcached mongodb
3737

38+
# Add a non-root user to help install ffmpeg:
39+
ARG PUID=1000
40+
ENV PUID ${PUID}
41+
ARG PGID=1000
42+
ENV PGID ${PGID}
43+
44+
RUN addgroup -g ${PGID} laradock && \
45+
adduser -D -G laradock -u ${PUID} laradock
46+
3847
#Install BCMath package:
3948
ARG INSTALL_BCMATH=false
4049
RUN if [ ${INSTALL_BCMATH} = true ]; then \
@@ -69,6 +78,12 @@ RUN if [ ${INSTALL_PHPREDIS} = true ]; then \
6978
&& docker-php-ext-enable redis \
7079
;fi
7180

81+
ARG INSTALL_FFMPEG=false
82+
RUN if [ ${INSTALL_FFMPEG} = true ]; then \
83+
# Add ffmpeg to horizon
84+
apk add ffmpeg \
85+
;fi
86+
7287
WORKDIR /usr/src
7388
RUN if [ ${INSTALL_CASSANDRA} = true ]; then \
7489
git clone https://github.com/datastax/php-driver.git \

laravel-horizon/supervisord.d/laravel-horizon.conf.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[program:laravel-horizon]
22
process_name=%(program_name)s_%(process_num)02d
3+
user=laradock
34
command=php /var/www/artisan horizon
45
autostart=true
56
autorestart=true

0 commit comments

Comments
 (0)