Open dieter-medium opened 3 months ago
Doing it the other way around had the following issue: https://github.com/microsoft/vscode-dev-containers/issues/537.
This issue might explain why some developers choose to use:
services:
network_manager:
image: alpine:latest
command: ["sleep", "infinity"] # Keeps the container running
app:
...
network_mode: service:network_manager
It's an interesting approach to managing shared network environments in Docker Compose. Perhaps IntelliJ will improve its support for this pattern in the future.
I encountered an error with port publishing and the container type network mode while using IntelliJ. It seems to be related to the network mode setting.
Error: conflicting options: port publishing and the container type network mode
The issue seems to occur due to the network mode configuration in the docker-compose.yml. Specifically, in javascript-node-postgres and simalar.
The error is resolved if the network_mode setting is switched between app and db services. For instance, instead of using network_mode: service:db within the app, using network_mode: service:app within db resolves the error.
References: