-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to dockerize? #3
Comments
Hi @donkee, I've created a Dockerfile for the version 2.0 of this solution :
I hope this is gonna be helpful. |
Hi @AbdelatifAitBara , thanks for commenting. This isn't a viable solution for me, however, since it still requires copying the entire project contents into the container. The NextJS Dockerfile copies some optimized files/folders that are generated when you have |
Hi @donkee, Ok, I got you now ;) , could you tell me please the smaller image size that you have achieved ? |
Hi @AbdelatifAitBara , my images are about 500MB right now. |
Hi @donkee, Yea me as well, I got the same size anyway, if I find a better solution I'll keep you on touch. |
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 theoutput: '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.
The text was updated successfully, but these errors were encountered: