Docker Community Forums

Share and learn in the Docker community.

How to run multiple commands in docker start


(Askeralim) #1

I am pretty new to the docker, I have developed an application in node.js using “create-react-app”.
I want to deploy the server and client in the same docker.

I am starting the server socket by command : node app.js
the client by command : yarn start

Please help me to get the correct docker file details so that i can run the docker using “docker-compose”.


(David Maze) #2

You want two separate containers, and possibly two separate images.

Docker has an excellent official tutorial on building and running custom images. If you run something like

docker network create mynet
docker run -d --net mynet --name myserver myserver
docker run --net mynet --name myclient -e SERVER_URI=http://myserver/ myclient

then the application in the client container can make requests of the application in the server container.