Report this

What is the reason for this report?

How does one add binarys or buildpacks to the image used by the Apps platform?

Posted on February 21, 2021

I am trying to build a PHP worker that has the ffmpeg binary installed to transcode a video. I have included the ffmpeg composer extension so I can access the library but don’t understand how I can adjust what is installed on my worker container.

In another community post it seemed like your could build your own dockerbuild file and that would get you most of what was needed, but I didn’t really follow how that worked on the app platform.

HALP.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Heya,

In DigitalOcean App Platform, you can customize your worker container by creating your own Dockerfile. From there, you can specify to install the ffmpeg binary for video transcoding purposes. When you deploy your application with the App Platform, it will read this Dockerfile to build your worker with the necessary environment.

Below is a simple example of how a Dockerfile installing ffmpeg might look:

FROM php:7.4-fpm

RUN apt-get update && apt-get install -y \
    ffmpeg \
    && apt-get clean && rm -rf /var/lib/apt/lists/*

You should replace “php:7.4-fpm” with the base image appropriate for your environment. Make sure you also include any necessary commands for installing PHP and the ffmpeg composer extension.

Hope that this helps!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.