substrate icon indicating copy to clipboard operation
substrate copied to clipboard

Automatically change port mapping if PORT 8000 is already used

Open tanguyNaets opened this issue 4 years ago • 1 comments

When working on several poetry cookie cutter projects (and/or with other apps that use port 8000), the devcontainer won't work because the port 8000 is already used by those other projects/apps.

Simply manually setting a different port in the docker-compose.yml and pyproject.toml for each of the projects does the trick.

But it would be nice to have something like what jupyter notebook and lab do. I.e. trying their default port number, and using another one if the first one is already used, and another one if the second one is already in use, etc. WDYT?

tanguyNaets avatar Mar 28 '22 08:03 tanguyNaets

Yes indeed, would be nice to improve this. VS Code does some automatic port mapping already for dev containers I believe, but needs to be investigated how that interacts with Docker compose.

lsorber avatar Mar 28 '22 20:03 lsorber