DEV Community

Discussion on: 10 docker-compose and docker commands that are useful for active development

Collapse
 
sairoko12 profile image
Cristian Benavides Jimenez • Edited

Another powerful commands

Stop and clean up your docker-compose services (because yolo):

docker-compose down -v --rmi all

Build and start services in single line:

docker-compose up --build

Build and start in background:

docker-compose up -d --build

Run command with docker-compose:

# docker-compose exec [service_name] [command]
docker-compose exec django python manage.py shell

See the logs an specific service

docker-compose logs -f [service_name]

Enjoy!

Collapse
 
oreynaldocl profile image
Oscar Callisaya

Good commands, for log I like to add --tail in order to avoid to see only last X logs
docker-compose logs -f --tail [number] [service_name]