From 4417083a80870340189b2ddf05e55c7c7863fcde Mon Sep 17 00:00:00 2001 From: Tunde Aromire Date: Wed, 8 May 2019 16:27:39 +0200 Subject: [PATCH] Installation of ffmpeg (#2118) * Install ffmpeg in workspace and php-worker. --- DOCUMENTATION/content/documentation/index.md | 4 ++++ docker-compose.yml | 2 ++ env-example | 2 ++ php-fpm/Dockerfile | 13 +++++++++++++ php-worker/Dockerfile | 6 ++++++ 5 files changed, 27 insertions(+) diff --git a/DOCUMENTATION/content/documentation/index.md b/DOCUMENTATION/content/documentation/index.md index 17847a31..d77adeec 100644 --- a/DOCUMENTATION/content/documentation/index.md +++ b/DOCUMENTATION/content/documentation/index.md @@ -1728,6 +1728,10 @@ To install FFMPEG in the Workspace container 3 - Re-build the container `docker-compose build workspace` +4 - If you use the `php-worker` container too, please follow the same steps above especially if you have conversions that have been queued. + +**PS** Don't forget to install the binary in the `php-fpm` container too by applying the same steps above to its container, otherwise the you'll get an error when running the `php-ffmpeg` binary. + diff --git a/docker-compose.yml b/docker-compose.yml index 0ae4f2ff..b7ec7d03 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -172,6 +172,7 @@ services: - INSTALL_ADDITIONAL_LOCALES=${PHP_FPM_INSTALL_ADDITIONAL_LOCALES} - INSTALL_MYSQL_CLIENT=${PHP_FPM_INSTALL_MYSQL_CLIENT} - ADDITIONAL_LOCALES=${PHP_FPM_ADDITIONAL_LOCALES} + - INSTALL_FFMPEG=${PHP_FPM_FFMPEG} volumes: - ./php-fpm/php${PHP_VERSION}.ini:/usr/local/etc/php/php.ini - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG} @@ -206,6 +207,7 @@ services: - INSTALL_AMQP=${PHP_WORKER_INSTALL_AMQP} - INSTALL_GHOSTSCRIPT=${PHP_WORKER_INSTALL_GHOSTSCRIPT} - INSTALL_SWOOLE=${PHP_WORKER_INSTALL_SWOOLE} + - INSTALL_FFMPEG=${PHP_WORKER_INSTALL_FFMPEG} - PUID=${PHP_WORKER_PUID} - PGID=${PHP_WORKER_PGID} volumes: diff --git a/env-example b/env-example index ae649e52..e5536f7e 100644 --- a/env-example +++ b/env-example @@ -180,6 +180,7 @@ PHP_FPM_INSTALL_APCU=false PHP_FPM_INSTALL_YAML=false PHP_FPM_INSTALL_ADDITIONAL_LOCALES=false PHP_FPM_INSTALL_MYSQL_CLIENT=false +PHP_FPM_FFMPEG=false PHP_FPM_ADDITIONAL_LOCALES="es_ES.UTF-8 fr_FR.UTF-8" ### PHP_WORKER ############################################ @@ -193,6 +194,7 @@ PHP_WORKER_INSTALL_MYSQL_CLIENT=false PHP_WORKER_INSTALL_AMQP=false PHP_WORKER_INSTALL_GHOSTSCRIPT=false PHP_WORKER_INSTALL_SWOOLE=false +PHP_WORKER_INSTALL_FFMPEG=false PHP_WORKER_PUID=1000 PHP_WORKER_PGID=1000 diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 55caca15..17a98410 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -643,6 +643,19 @@ RUN if [ ${INSTALL_MYSQL_CLIENT} = true ]; then \ apt-get -y install mysql-client \ ;fi +########################################################################### +# FFMPEG: +########################################################################### + +USER root + +ARG INSTALL_FFMPEG=false + +RUN if [ ${INSTALL_FFMPEG} = true ]; then \ + apt-get update -yqq && \ + apt-get -y install ffmpeg \ +;fi + ########################################################################### # Check PHP version: ########################################################################### diff --git a/php-worker/Dockerfile b/php-worker/Dockerfile index fe9f53be..dd7ed040 100644 --- a/php-worker/Dockerfile +++ b/php-worker/Dockerfile @@ -69,6 +69,12 @@ RUN if [ ${INSTALL_MYSQL_CLIENT} = true ]; then \ apk --update add mysql-client \ ;fi +# Install FFMPEG: +ARG INSTALL_FFMPEG=false +RUN if [ ${INSTALL_FFMPEG} = true ]; then \ + apk --update add ffmpeg \ +;fi + # Install AMQP: ARG INSTALL_AMQP=false