I am working with Docker and I have a web-app that requires the following:
- Tomcat
- PostgreSQL
- MongoDB
To install item 2 and 3 I do the following:
I can run a command for PostgreSQL like :
docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
For Mongodb I run:
docker run --name some-mongo -d mongo
For Tomcat, I have a Dockerfile with Tomcat and copying my war to the apps folder. I build the image using Docker and run it.
My question is whether there is a better way to coordinate this step by step via separate script? Is Docker compose the solution for this?
thanks
docker-composeis meant for exactly this sort of situation. You should try it out and see if it meets your needs.