How to correctly use docker to run webdev?

  docker, question

The php nginx service at the back end runs on docker.

Now I want to run the front-end building tools on docker, such as node gulp, etc.

What should I do with this workflow and create a new container? If there are multiple projects, how should they be operated?

This Case ….
There are 1,000 docker environments in the eyes of 1,000 people.
It depends on how you organize the network and how you cooperate with the application.

1. Personally, I am used to treating dockers like process, so I will try my best to pursue a container instance to suspend only one process, because I think that if N applications are all running in one container, then the container is not process level, but OS/ machine level. If virtual machine image is built, why do I need Docker image? . That is, even if php and nginx cooperate, they will make up two containers, which can be regarded as one application. Then in other languages, like other applications you implement with nodejs, I will definitely run another container instance and then run nginx to replace the two. So would you like to ask whether your nginx+php docker is a container?
2, there are also mixed multiple processes in a docker, after all, it is still based on an operating system From [OS]. You can run a process monitor like a supervisor(python) in the docker and give the supervisor to the docker to hang. Do you have pm2(nodejs) for the same application?
This dockerfile is hard to write anyway.
3. Blending. The best way to feel it is to look at the specific business scenarios. The architecture is to use limited resources to maximize the business.
It is suggested to look at the advantages brought about by docker and the price to be paid for such advantages before making a better decision. Otherwise, it is better not to use it indiscriminately.