💻 Tech
Some of the things I learned about docker-compose.
docker-compose exec migrate sh- This will open a shell inside the container of the servicemigrate. You can then run commands inside the container like checking the logs and files. If you’re familiar with k8s, this is similar tokubectl exec.docker-compose logs db- This will show the logs of the servicedb.docker-compose up --build --remove-orphans- This will build the images and remove the containers of services that are not in thedocker-compose.ymlfiledocker-compose up --force-recreate- This will force recreate the containers of the services in thedocker-compose.ymlfile. For example, if you have a postgresql service, without the flag a stopped container will be reused. With the flag, a new container will be created.