Hi! Today I tried to deploy a Payload app using docker and PM2 in ubuntu 16, in a DigitalOcean VPS, but I still getting issues, in case of PM2 when I ran "yarn build" and "pm2 start dist/server.js" it returns in "payload.config.js is not found" and in case when I ran docker compose it doesn't return any issue, but when I tried to access to the website it never loads.
Using the javascript template specifically I had to go in and manually change the pathing for most of the commands. By default, they lead to 'src/' when the structure of the template was './'
yeah if you can't find your Payload config, make sure you have an
env
variable that points directly to your production Payload config
generally our production start command includes setting the
PAYLOAD_CONFIG_PATH
like so:
"serve": "cross-env PAYLOAD_CONFIG_PATH=dist/payload.config.js NODE_ENV=production node dist/server.js",
do you have something like this? and if so, is your config truly located where your env is telling it to be found? in the above case, it's
/dist/payload.config.js
I have added the URL of my app to env file and It works fine! It was the issue
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.