Override the Default Command with Docker Compose

In our current Planets docker development setup we start planets with Docker Compose:

docker-compose up -t 30 -d

The configuration file docker-compose.yml looks something like for the Planets-Hompage container:

Planets-Homepage:
  image: planets/homepage:latest
  ports:
    - "28083:8080"

Sometimes arises the need to create a remote debugging session to an application running inside a container. In our case this is an Eclipse Virgo base application. Docker Compose allows Extending services and Compose files. Create a docker-compose.override.yml aside of your main docker-compose.yml configuration to override the main settings:

Planets-Homepage:
  ports:
    - "8000:8000"
  command: /home/virgo/bin/startup.sh -debug 8000

This snippet starts Virgo with debug enabled.