I discovered that Docker Compose places containers in a separate network when using version 2 of their YAML syntax. This makes linking with existing containers difficult.
Is there a way to prevent this, and revert to the behavior of version 1, without actually reverting?
Advertisement
Answer
Is there a way to prevent this, and revert to the behavior of version 1, without actually reverting?
In your service configuration, specify:
network_mode: bridge
For example:
version: "2" services: web: build: web network_mode: bridge