Used docker-compose
to dockerized a web application. It includes app/db.
I separated the images from app/db and put them into docker-compose.yml
file.
So run $ docker-compose build
can build all the images. And run $ docker-compose up
can start all the container services.
But, I want to make a hole image like $ docker build -t app .
, how to run it?
I tried $ docker run -it app
but not work as $ docker-compose up
.
Docker compose is an orchestrator for MULTI container deployment. So won't be useful for creating a single image.
I would recommend keep the containers separate for production clusters but you can have multiple services with in a single container. Try supervisor or some other process manager, docker official documentation has all the details.
Let me know if it doesn't explain I will add an example here.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.