Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging and autocompletion in IDE #1

Open
okhomenko opened this issue Feb 23, 2017 · 1 comment
Open

Debugging and autocompletion in IDE #1

okhomenko opened this issue Feb 23, 2017 · 1 comment

Comments

@okhomenko
Copy link

Great article, thanks.

I've been playing with docker-compose for dev a few months back, but still wasn't satisfied as far as debugging and autocompletion.

Since you run everything in docker, you inject your source code into container, but node_modules are not available in IDE for autocompletion.
Another problem is debugging.

Do you handle it somehow?

--
Thanks,
Alex

@anorsich
Copy link
Collaborator

@okhomenko This is a very good question! I had exactly same problems and somehow forget to answer them in the blog post.

I don't use much of IDE autocompletion or debug for Javascript applications. Most of the team members use Atom and some code style plugins such as linter and eslint-linter. To make them actually work we had to install eslint and other plugins on a host machine manually.

I can imagine few ways to solve the problem:

  1. Hack the ./bin/start.sh script and copy node_modules from running containers to the host machine using docker cp
  2. Just install this packages manually from time to time.

As for debugging, I never really used it, but some our team members use node-inspector and just start along with the service like this:

"scripts": {
  "development": "run-p development:*",
   "development:server": "npm run build && NODE_PATH=../shared nodemon --debug=8281 src/app.js",
   "development:inspector": "node-inspector --web-port=8381 --debug-port=8281 --no-preload",
  ...
}

This is part of our package.json for some of the services. In Dockerfile.dev we start an application using npm run development, which starts both application and node-inspector.

Let's see if some of our readers know a better way to overcome these issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants