Deployed to EBS with Docker. First load is REALLY SLOW

default discord avatar
gaboluque
4 months ago
6

I've managed to deploy my Payload app to AWS EBS using docker. I'm using the example

Dockerfile

with the exception of the run command; instead of using node, I'm using pm2 (

CMD ["pm2-runtime","dist/server.js"]

)



Once it's deployed, the first load of the admin is SO SO Slow! API responses are ok, I imagine is something to do with webpack? But I'm not sure how to debug this. Any idea?

  • discord user avatar
    denolfe
    Payload Team
    4 months ago

    How slow are we talking? 3 seconds? 10 seconds? More?



    Do you see the same slowness when building the dockerfile then running it locally?

  • default discord avatar
    gaboluque
    4 months ago

    About a minute to first load

  • discord user avatar
    jmikrut
    Payload Team
    4 months ago

    whaaaaat



    do you have

    NODE_ENV=production

    ?



    you should be running in production mode, which should completely bypass Webpack and serve static, prebuilt admin files



    make sure you have that set and then you should be golden

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.