Question

PHP-FPM + NGINX on App Platform - Separated & Linked, or Single App?

Traditionally I was always running PHP-FPM and NGINX on separated Docker containers on the same network, as running a single service in a container is considered a best practice.

I started to migrate one of my project to App Platform, and I’m not sure whether its possible to run NGINX & PHP-FPM as separated services.

Which one is the preferred solution on App Platform currently?

  1. Keep PHP-FPM and NGINX Separated and link them (is there a variable maybe we can use in App Spec to let them to refer to each other?)
  2. Run PHP-FPM and NGINX in the same container as a single service.

Submit an answer


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!

Sign In or Sign Up to Answer

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.

Bobby Iliev
Site Moderator
Site Moderator badge
March 16, 2023

Hi there,

I personally have been mainly using the PHP Buildpack on App Platform as that takes away any complexity:

https://docs.digitalocean.com/products/app-platform/reference/buildpacks/php/

This lets you just deploy your PHP application by selecting your GitHub repository and then the Buildpack takes care of building and running your application.

I would probably go for a separate PHP-FPM and a separate Nginx container when deploying to a Kubernetes cluster.

In general, deploying everything in a single container would be simpler, but if you decide to go with separate containers, you would have e better control over the scalability of your app, as you will be able to add extra replicas for the specific container depending on the workloads.

Hope that this helps!

Best,

Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up