lostintangent / node-azure

Tutorials that illustrate how to build Node.js apps with VS Code, and deploy them to Azure
http://azure.com/node
10 stars 7 forks source link

Consider using Docker Extension commands for interacting with Mongo DB #13

Open nicolehaugen opened 7 years ago

nicolehaugen commented 7 years ago

In the pre-req section to work with Mongo DB, it says the easiest thing to do is run the following command after docker is installed: docker run -it -p 27017:27017 mongo.

However, it would even be simpler and drive the point home more about using the Docker extension, to instead have the user launch Mongo DB using the F1 Docker: Run command. Also, the user could then use Docker: Attach Shell to Running Container to interact with Mongo DB directly and easily see the data inserted locally.

lostintangent commented 7 years ago

@nicolehaugen79 We could do that, but in the current workflow, we don't introduce the Docker extension for VS Code until later, so I'd rather not require it as part of the pre-reqs. I'd like to "meet devs where they're at", and then progressively illustrate how we're striving to improve productivity.

As an aside, you could still use the Docker: Attach Shell command in VS Code in order to open a new shell to the MongoDB container that was run via docker run. The use of the Docker CLI and the Docker extension for VS Code aren't exclusive, since the later simply automates the same Docker commands you could run manually.

lostintangent commented 7 years ago

I'm going to close this as low-pri, since I think the existing workflow is sufficient. But I'd be happy to discuss it further.

nicolehaugen commented 7 years ago

@lostintangent I definitely see your point about keeping the pre-req section simplified.

One of the things I really like about VS code is being able to do everything in it, without having to go outside of it to launch a separate cmd line window, such as to run Mongo DB. When I initially went through the instructions, I launched a separate command line window (outside of VS Code) in order to run Mongo DB - this may not be what you intended, but this is what I did. :) Later, I realized this defeats one of the great features of VS Code in that you can do everything within it which really helps with one of the pain points that I have found with MEAN apps, in that you're dealing with lots of tools\environments.

It would be helpful if the doc clarified that the reader should/can do all of this within VS Code and that VS code allows you to switch between terminal sessions easily using the drop down (see screenshot below) - this will allow you to easily run the Mongo DB container and then also attach to it from another terminal window if needed later (such as using Docker: Attach Shell) - the key here is that this is all done in VS code without having to juggle a bunch of other different windows/environments which may not be obvious the first time walking through this toolset.

screenshot

lostintangent commented 7 years ago

I actually don't want to promote the "you can do everything in VS Code" point too strongly, as opposed to demonstrating that you can, while embracing developer choice. I think the tutorial helps show this via many of the integrated features, and I just want to fine a nice balance between increasing the nuance in order to state every possible workflow option, and introducing unnecessary complexity too early in the tutorial.

Did you want to submit a PR proposal for this suggestion and we can discuss it? I definitely want to incorporate your feedback.

nicolehaugen commented 7 years ago

Sure makes sense - I'll create a new issue and we can take it from there.