Hi all,
I am trying out grandnode2 with digitalocean.
I have followed this tutorial https://grandnode.com/grandnode-and-mongodb-in-a-3-minutes-the-fastest-installation-with-docker to install mongodb, grandonde2 on a ubuntu 20.04 machine with docker and everything works fine.
I am now trying to edit some code and build a docker image with the updated version, but for some reason it does not work (i.e. I go to the url and I get ERR_CONNECTION_REFUSED)
This is what I am doing .
1) I locally forked and cloned your repo https://github.com/grandnode/grandnode2
2) created a new branch and I am commenting out some code in the _CreateOrUpdate.Info.cshtml that I am not planning to use.
3) run "docker build --tag <my-tag> ." to create a docker image with the new code.
3.1) no errors here, the build is succesfull (NB: I did not edited any of your DockerFiles)
4) start the mongodb running "docker run -d -p 127.0.0.1:27017:27017 --name mongodb mongo"
5) run my new image "run docker run -d -p 80:80 --name <my-name> --link mongodb:mongo <my-tag>"
Expected result:
- working grandnode website with the edit I made
Actual result:
- non responsive website with error message: ERR_CONNECTION_REFUSED
My question would be what is the preferred way to apply small code changes to your code base and deploy this changes using Docker.
Of course, I could follow the "Manual Installation - Linux Installation from source code" and rebuild everytime I commit some code to the main branch, but I was wondering if there is a way to do this using Docker.
Please let me know and keep up with the great work :)
Kind regards,
Enrico
How to create custom grandnode images
Monday, November 25, 2024 6:58:10 PM
Well, if you want to pull the image from docker, you should update your image in Docker Hub with your app changes. If you want to make a changes directly inside the working app, you can use the Theme Editor plugin. It will give you possibility to modify views and css files "on air". In the other case, it's rather question for server administrator or Docker specialist, they will have the best knowledge about it.
Best regards,
Patryk
GrandNode Team
Patryk
GrandNode Team
0
Hi Patryk,
thanks for your reply :)
Yes, my image is already in a private repository in docker hub.
But my question is more about which command to run when building the docker image locally.
I am not that knowledgeable in Docker, but I assume that running
"docker run -d -p 80:80 --name grandnode --link mongodb:mongo grandnode/grandnode2:latest"
would be the same as
1) pulling the code from your github repo
2) build the docker image using your docker file "docker build -t grandnode-main -f Dockerfile ."
3) run the locally built image with "docker run -d -p 80:80 --name grandnode-main --link mongodb:mongo grandnode-main"
Unfortunately the second method does not work and I was wondering if you have any suggestions, examples of dockerfile or docker-compose file that can successfully run the app.
Please let me know and don't hesitate to ask me more information if my explanation is not clear enough :)
Thanks a lot and have a great day!
Enrico
thanks for your reply :)
Yes, my image is already in a private repository in docker hub.
But my question is more about which command to run when building the docker image locally.
I am not that knowledgeable in Docker, but I assume that running
"docker run -d -p 80:80 --name grandnode --link mongodb:mongo grandnode/grandnode2:latest"
would be the same as
1) pulling the code from your github repo
2) build the docker image using your docker file "docker build -t grandnode-main -f Dockerfile ."
3) run the locally built image with "docker run -d -p 80:80 --name grandnode-main --link mongodb:mongo grandnode-main"
Unfortunately the second method does not work and I was wondering if you have any suggestions, examples of dockerfile or docker-compose file that can successfully run the app.
Please let me know and don't hesitate to ask me more information if my explanation is not clear enough :)
Thanks a lot and have a great day!
Enrico
0