tokyo-free-white-nextjs-admin-dashboard icon indicating copy to clipboard operation
tokyo-free-white-nextjs-admin-dashboard copied to clipboard

How to dockerize?

Open donkee opened this issue 10 months ago • 5 comments

I can't dockerize this app using the NextJS with-docker example, but it isn't working correctly. The docker container starts up and runs, but the app doesn't load when navigating to the URL. I've tested with a fresh NextJS app and it works fine, so I'm guessing something is set up different in this one that isn't compatible. The only way I've gotten it to work is to copy the whole project into the image and run it with yarn start. However, this isn't ideal as it copies literally everything in the folder into the image which bloats the size immensely, making it slow to build, slow to upload to our repository, and slow to then download to our hosting environment. The NextJS example does some optimization (using the output: 'standalone' feature) and also only copies the modules that are actually needed which greatly reduces the size of the final image. Our current method of making a docker image adds 10 minutes to our CICD pipeline just to build and upload the image.

donkee avatar Sep 01 '23 14:09 donkee