Docker Compose

This is an add-on for Docker where you can specify whole sets of services into a single file and start them at once. You can also port container setups to other servers more easily.

inspect service docker inspect $(docker-compose ps -q SERVICENAME)
inspect all services docker inspect $(docker-compose ps -q)
execute something in a container docker exec CONTAINERNAME COMMAND
get a shell in a container docker exec CONTAINERNAME sh
show all mounted paths docker inspect -f '{{ ..:index-.mounts-0-.source }}' $(docker-compose ps -q)
docker-compose build --no-cache
version: '3'
     - webproxy
    external: true

isn't able to connect to container

expose the port:

      - "80"


reload nginx config

docker kill --signal=HUP docker-gen


Maybe there's still a volume left over from docker-compose down? Check with docker volume ls and remove with docker volume prune and docker volume rm.

Do not mount the folder where your docker-compose.yml and env-files are into a container. If your container is breached, one could easily gain root access to the whole host system!

Do use a reverse proxy. It makes handling SSL certificates and load balancing much easier.

  • Last modified: 2024-07-05 14:31