vagrant-docker-compose icon indicating copy to clipboard operation
vagrant-docker-compose copied to clipboard

Is "docker-compose.override.yml" supported?

Open 2trc opened this issue 9 years ago • 2 comments

Hi, I was wondering if "docker-compose.override.yml" was supported as stated in Extending services and Compose files

By default, Compose reads two files, a docker-compose.yml and an optional docker-compose.override.yml file. By convention, the docker-compose.yml contains your base configuration. The override file, as its name implies, can contain configuration overrides for existing services or entirely new services.

I tried but it didn't work for me (both yml files residing in the same folder)

2trc avatar Sep 05 '16 14:09 2trc

I'm using something like this in my Vagrantfile:

  # Use Docker Compose
  # Plugin: https://github.com/leighmcculloch/vagrant-docker-compose
  docker_yml = ["/vagrant/docker/docker-compose.yml"]
  # The docker provisioner doesn't autodetect the override.yml
    if File.exist?("docker/docker-compose.project.override.yml")
      docker_yml << "/vagrant/docker/docker-compose.project.override.yml"
    end
      if File.exist?("docker/docker-compose.override.yml")
        docker_yml << "/vagrant/docker/docker-compose.override.yml"
      end
  config.vm.provision :docker
  config.vm.provision :docker_compose,
    yml: docker_yml

das-peter avatar Nov 09 '16 02:11 das-peter

Ahh, we could add loading both in the next version I think. @2trc did you want to open a pull request adding it? Otherwise I'll put it in the queue of things to get done.

leighmcculloch avatar Nov 09 '16 05:11 leighmcculloch