How can I deploy a Payload app in a droplet?

default discord avatar
Japineda16
2 months ago
6

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.

  • default discord avatar
    badjab326
    2 months ago

    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 './'

  • discord user avatar
    jmikrut
    Payload Team
    2 months ago

    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
  • default discord avatar
    Japineda16
    last month

    I have added the URL of my app to env file and It works fine! It was the issue

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.