Documentation improvement suggestions - production deployment #2288
hades200082
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
After deploying my first two Payload CMS applications to different places I feel that the existing documentation, while excellent for developers and during development, has very little "real world" info for deploying Payload CMS as a production application.
There were a number of things I hit during deployments (as a newbie to deploying Payload but with 25+ years of commercial software development & systems architecture under my belt)
My proposal in this thread is that a section be added to the Payload documentation where more detailed deployment instructions can be placed for various cloud platforms.
As a minimum I'd recommend:
Additionally, many Payload users may benefit from more detailed guides for:
For example, some of the issues I hit with Azure ...
1. Admin UI kept trying to look at localhost:3000 for the API
Need a way to set the
serverUrl
in the payload config that both allows for different environments (i.e. deployment to different app services, or app service deployment slots) and works for both the Express app and the Admin UI.2.
PAYLOAD_PUBLIC_
environment variables don't get passed to Admin UI if you use CI/CD/DevOps deployments or Dockerfile deploymentFor Dockerfile deployments these need to also be added as
ENV
lines in the Dockerfile, which meansa) each environment needs its own Dockerfile - not ideal.
b) these Dockerfiles need to be committed to git where you may not want to expose certain things
For regular ZipDeploy from DevOps (or WebDeploy), the same issue occurs but I wasn't able to solve it.
3. When not using Dockerfile deployment, the listen port in Payload needs to be set from an environment variable
Azure creates this variable by default, but a code change is needed to use it. Since using a
PORT
environment variable is fairly common across different cloud hosts it might be worth adding this to the default install.At the end on Azure, I had to create a separate Dockerfile for each environment. an Azure Container Registry to build & push them to from DevOps and it took a lot of fiddling and figuring out to get working overall.
The other deployment I've done was to Railway which, while somewhat simpler, but still required the
PORT
change and has issues with MongoDB Atlas (you have to open your Atlas instance to all IP addresses :( )Beta Was this translation helpful? Give feedback.
All reactions