I'm deploying my first production ready project in a few days. Would love to better optimise my current pipeline
Did you made project dockerized?
In my most recent deployment, I used DevOps Pipelines deploying to Azure App Services with a MongoDB Atlas instance from the Azure Marketplace.
I created a new Dockerfile for each environment (dev, qa, uat, production).
In each Dockerfile, I added a line before the npm install
(different URL in each reflecting the environment's URL.
In my Payload Config, I use the environment variable to set the
Note: This could also have been achieved using
.env.<environment-name>files and a single Dockerfile.
In my DevOps
file I use variables to determine which Dockerfile to use depending on which git branch triggered the pipeline.
I build and publish the relevant Dockerfile to an Azure Container Registry.
The Azure App Services were created as Docker app services and are deployed from the Azure Container Registry, re-deploying via webhook whenever the associated docker image is updated.
I found this was the only way to get it working in Azure App Services due to the fact that the
variables need to be present atbuild time
so they are passed to the admin app, and a bug in Kudu ZipDeploy that breaks
symlinks preventing any kind of
on the app service itself. (
also doesn't work on app services due to file permissions)
I've opened a discussion athttps://github.com/payloadcms/payload/discussions/2288
to talk about improving the Payload documentation in regards to production deployments and CI/CD.