Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Node/Mongo docker-compose's mongoDB container should be available to the local host #506

Closed
diberry opened this issue Aug 19, 2020 · 6 comments

Comments

@diberry
Copy link
Contributor

diberry commented Aug 19, 2020

The mongo container should be available externally or at least give me the commented out docker-compose settings. This dev container is supposed to help me debug but isn't helpful if I can't see what eventually gets in the DB.

The container should also work for windows/linux/mac. Windows is picky about the host for a mongo container.

@anthonychu
Copy link
Member

Another option to think about is to add the MongoDB extension to the devcontainer. That way the user can browse and manage the DB even without tools installed locally on their machine.

If Codespaces eventually supports compose, this would also be helpful there as the extension is available in the in-browser editor.

@Chuxel
Copy link
Member

Chuxel commented Aug 20, 2020

The container should also work for windows/linux/mac. Windows is picky about the host for a mongo container.

Can you be more specific? To be clear, MongoDB is in a separate container, so localhost inside the web container won't work on any platform if that is what you are referring to. It's like having two machines sitting next to each other.

Another option to think about is to add the MongoDB extension to the devcontainer. That way the user can browse and manage the DB even without tools installed locally on their machine.

That's a good point -I'd tend to prefer this option rather than exposing a port by default without the developer knowing about it. The container will also fail to start if the port is in use.

If Codespaces eventually supports compose, this would also be helpful there as the extension is available in the in-browser editor.

It actually does today!

@anthonychu
Copy link
Member

It actually does today!

I have clearly missed the memo. This is great news!

@diberry
Copy link
Contributor Author

diberry commented Aug 20, 2020

Port forwarding works - I didn't see it in the .devcontainer.json file - can it be added but commented out? Along with the note that it can be done temporarily from the command bar?

@Chuxel
Copy link
Member

Chuxel commented Aug 20, 2020

Yep, I added it into the devcontainer.json when you raised your earlier issue since it actually was supposed to be there. It's in pretty much every other definition - so it, just got missed here for some reason. ☹️ Sorry about that!

Can also review extensions to see if there's one to include by default. Database ones have lower usage numbers but the Azure DB extension does support straight mongo as well. Need to think through that a bit.

@Chuxel
Copy link
Member

Chuxel commented Aug 22, 2020

Should be resolved with #509

@Chuxel Chuxel closed this as completed Aug 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants