payloadcms / remix-server

Monorepo template with Remix and Payload
MIT License
111 stars 16 forks source link

How can I deploy to Vercel? #5

Closed yulafezmesi closed 1 year ago

yulafezmesi commented 2 years ago

Hi, thank you for the great boilerplate!

I've tried to deploy Vercel according to the below building configs. however, the build progress never ends, and no errors. is there any mistake over here?

image

vercel config:

"settings": {
    "createdAt": 1669534729223,
    "framework": null,
    "devCommand": null,
    "installCommand": "pnpm install",
    "buildCommand": "pnpm build && pnpm serve",
    "outputDirectory": "apps/server/dist",
    "rootDirectory": null,
    "directoryListing": false,
    "nodeVersion": "18.x"
  }
dsod commented 1 year ago

Hi! Glad you like it.

I believe the settings.buildCommand should be: pnpm build.

I think you will have a few issues beyond that point though. The project is set up to have Remix and Payload run on the same express server, which lives in the apps/server folder. While I have not deployed to vercel myself, I would try this approach: https://vercel.com/guides/using-express-with-vercel#standalone-express. It looks like they support express.static which the project use to serve the actual Payload admin UI, and more.

dsod commented 1 year ago

After giving Vercel a try my conclusion is that the structure of the project and loading payload as a single file (both the express server and payload config) isn't really a good fit.