seelio / node-inspector-docker Goto Github PK
View Code? Open in Web Editor NEWAn example of using node-inspector with docker
An example of using node-inspector with docker
Hello,
I'm quite new to docker and this repo has been very useful to me, but as of today it's outdated.
I'm using docker 1.11.2
and can't run the example because of the many errors in the docker-compose.yml
but I fixed them and it actually works.
However, given this docker-compose.yml:
version: "2"
services:
app:
build:
dockerfile: Dockerfile-dev
context: ./
image: myapp
ports:
- '3000:3000'
- '8081:8081'
# needed by debugger
- '8080:8080'
volumes_from:
- code
debugger:
image: node-debug
depends_on: [app]
# `service` instead of `container` for an easier cold start
network_mode: 'service:app'
volumes_from:
- code
code:
image: node
volumes:
- './code:/app/code'
And this Dockerfile for node-debug
:
FROM node
RUN npm install -g node-inspector
EXPOSE 8080 # I also tried without exposing the port
ENTRYPOINT ["node-debug"]
When I run docker-compose up
, my app start and run as expected, BUT I cannot access the debugger even if I can see the message about listening on http://127.0.0.1:8080/?port=5858
.
Any ideas?
Thanks for this great example!
However, I couldn't make it work. When I run docker-compose up I get:
ERROR: Service 'node-app-inspector-instance' uses the network stack of container 'node-app' which does not exist.
It seems that docker checks if the container node-app exists before bringing everything up. And at this moment node-app is not yet created.
How did you manage to make it work?
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.