Docker-compose is a very useful tool when you need to orchestrate multiple containers.
Here are some useful tips and best practises.
Build container
Build and start containers in detached mode:
1 |
docker-compose up -d --build [options] |
1 |
The following options available: |
- –no-deps – ignore the container dependency
- –no-cache – ignore the cache
Container logs
1 |
docker-compose container logs [options] nginx |
Control containers
The following command will stop and the remove all docker-compose containers:
1 |
docker-compose stop && docker-compose rm -f |