-
Notifications
You must be signed in to change notification settings - Fork 40
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
[IMPROVE] Dockerfile to support hot-reload #74
base: main
Are you sure you want to change the base?
Conversation
Hey @SarveshLimaye Thanks for the PR. Did you also fix the BUILD_KIT issue? If not, can you please research more about it and try to come up with a solution? |
Hey @Dnouv , I have not fixed the BUILD_KIT issue. in this pr. The issue is still open on the docker/buildx github repository , so there is no official solution available to this. Currently, BuildKit only supports four network modes: "bridge", "host", "none" and "container:<name|id>". So I guess it's not possible to solve this error unless there is some support added in the official docker repository, but we can obviously find some way around. After reading the discussions I found this way around to be super useful - We can create a new sh and try to run it in DOCKERFILE. The sh can be similar to the following - moby/buildkit#978 (comment) Since there is no official solution available to this, we need to try out a lot of different ways on a separate branch. I think it would be better if we try to solve the BUILD_KIT issue on a different PR. Do let me know if you find any better solution. |
@SarveshLimaye ok, sounds good. I tried out this PR (with
Please pull the latest changes from the Also, you will have to add a new dockerfile for the development environment, since as you can find here we are doing a production build, and AFAIK NextJS won't watch for file changes in the production build. Please look into this issue. Thank you! |
@Dnouv I have added Docker file for development environment. Could you pls take a look at changes ? |
Hey @Dnouv , I have fixed all the errors and everything is working fine. Could you please take a look ? screen-capture.2.webm |
Nicely done, @SarveshLimaye ! However, could you please take a look, this does not seem to work on Gitpod, I always get this error: Once this is fixed the PR is good to merge. I have tried building the new Dockerfile, and it works quite well. Thank you! |
Hey @Dnouv, Thanks for the review. I once encountered this error when I tried building the docker file without starting the backend server. I just tested building the dockerfile on gitpod and its working fine . screen-capture.6.webm |
Any idea why that occurs? |
@Dnouv AFAIK it can happen because of the following reasons -
|
Oh ok, I am trying once again with all the backend up and running. |
@SarveshLimaye, you see here, I have set the |
Hey @SarveshLimaye
Also, update the docs to incorporate this method of starting the development environment. If possible, try to make changes in the
Should start a docker development image of NextJS. Please rename And lastly, please don't make the NextJS fix on port 3000 so that if the user's local port
This is the variable that is set to the available port you only need to pass this on to the Docker Compose. Once these changes are done, please ping me. Thank you! |
@Dnouv I am really not sure how to make changes in startNext.sh to start the docker development image of NextJs using command Also, I just had a question related to updating docs. Should I update docs to the same steps as we are running the dockerfile now . Something like - or wait until we find a way to build dockerfile using this command - |
@Dnouv all the suggested changes done ! |
Fixes : #48
Added volumes in docker-compose.yml to support hot reload in next-js