My docker compose files in different projects are interfering

I have 2 projects (called app-api and chat-api) and I'd like to use docker-compose configuration in each.

Both projects have such structure:

root
|_ .idea
|_ deployment
   |_ database.Dockerfile
   |_ web.Dockerfile
  |_ api.Dockerfile
  |_ docker-compose.yml
|_ rest of project's code...

If I create new docker-compose configuration in 1st project, give it docker-compose.yml and set project name via env. variable (COMPOSE_PROJECT_NAME=app-api) I can run it. It will compose Docker images and I can see them in Services tab.

But if I then go to 2nd project and create similar configuration (but pointing to docker-compose.yml in 2nd project) I'll get an error:

Deploying 'Compose: deployment'...
Failed to deploy 'Compose: deployment': Can't read compose file at [...]\app\deployment\docker-compose.yml

Plugin incorrectly takes docker-compose.yml from 1st project instead of 2nd. It should take one in

[...]\chat-api\deployment\docker-compose.yml

Screenshot of 2nd configuration:

If I use command

[...]\chat-api>docker-compose -f deployment/docker-compose.yml -p chat-api up --build

containers are composed and started correctly therefore I think the issue is with plugin. Does anybody know how to use it correctly or work around that bug (if it is a bug...)?

1 comment
Comment actions Permalink

I have a very similar problem. When using the docker compose command in project A, it works file. Then I bring that down and go to project B to bring its docker compose up. It works, BUT it uses the docker compose file from project A incorrectly.

0

Please sign in to leave a comment.