Home > Back-end >  Edit an HTML file in Docker Container
Edit an HTML file in Docker Container

Time:06-28

I am starting out with programming and am currently working with Docker Containers.

One of the containers is a webserver that takes an input from another container and displays an output on a web page on localhost.

I was wondering if it would be possible to change some comments on the webpage that is part of the container and if so how to go about it?

PS: Pretty new to all this, so please forgive me if I'm asking something really basic

CodePudding user response:

Depends upon the strategy, if you need to change it dynamically when you change the code. You should mount the directory on the container via docker command or docker-compose file. If it is static copy the files via docker file.

CodePudding user response:

It is strange that you are a beginner to programming and are working with docker containers. But now you are here.

Find out if the files you want to edit are part of a container ('baked in') or if they get mounted at container runtime.

  • If they are baked in, you would go to the bakery (docker build ...) and modify files so that you get modified containers.
  • If they are mounted at runtime (docker run -v ...) find out where they get mounted from and modify the files over there.

Baked in files cannot be changed just like that, so they reflect an immutable installation. The other files can be changed at runtime. There is no right or wrong, choose the pattern depending on what you want to achieve. That is where the strategy comes into play.

  • Related