strongloop / strong-pm

deployer for node applications
http://strong-pm.io
Other
1k stars 71 forks source link

Latest strong-pm docker image breaks app #221

Closed Bohmaster closed 9 years ago

Bohmaster commented 9 years ago

5 weeks ago I've followed this tutorial https://strongloop.com/strongblog/run-create-node-js-process-manager-docker-images/ and my deployment process worked just fine. A week ago I did it again (updating my image) and my app broke (not running on port 3000). I did an slc run and the port 3000 was running it just fine.

Then I've followed the tutorial again but instead of using the "strongloop/strong-pm" docker image, I've used this: https://registry.hub.docker.com/u/idosh/strong-pm/

And now my app works fine again.

rmg commented 9 years ago

The ports changed when multi-app support was added. Your app would have been running on port 3001 (3000 + service id).

Bohmaster commented 9 years ago

Thank you for your rapid response.

This command is still useful?

docker run --detach --restart=no \ --publish 8701:8701 --publish 3000:3000 \ --name strong-pm-container \ strongloop/strong-pm

If I underestand my app should be running on port 3001? I don't understand what "(3000 + service id)" means.

Thanks again!

rmg commented 9 years ago

@Bohmaster that is correct, the install script needs to be updated.

Bohmaster commented 9 years ago

@rmg I can't get it to work. Could you please show me how the new install script should be implemented? Thanks!

From the begeening. I removed all my containers and images.

rmg commented 9 years ago

The --publish 3000:3000 should be changed to something like --publish 3001-3010:3001-3010 so that a range of ports is published.

Bohmaster commented 9 years ago

@rmg I'm sorry, I don't want to bother you. I've tried that configuration but my app is not running on any port.

tcp6 0 0 :::3001 :::* LISTEN 0 4023658 25658/docker-proxy tcp6 0 0 :::3002 :::* LISTEN 0 4023763 25702/docker-proxy tcp6 0 0 :::3003 :::* LISTEN 0 4023679 25667/docker-proxy tcp6 0 0 :::3004 :::* LISTEN 0 4023784 25711/docker-proxy tcp6 0 0 :::8701 :::* LISTEN 0 4023847 25738/docker-proxy tcp6 0 0 :::3005 :::* LISTEN 0 4023700 25676/docker-proxy tcp6 0 0 :::3006 :::* LISTEN 0 4023721 25685/docker-proxy tcp6 0 0 :::3007 :::* LISTEN 0 4023805 25720/docker-proxy tcp6 0 0 :::3008 :::* LISTEN 0 4023826 25729/docker-proxy tcp6 0 0 :::3009 :::* LISTEN 0 4023742 25693/docker-proxy tcp6 0 0 :::3010 :::* LISTEN 0 4023637 25649/docker-proxy

This is the script I've used:

docker run --detach --restart=no \ --publish 8701:8701 --publish 3001-3010:3001-3010 \ --name strong-pm-container \ strongloop/strong-pm

My hostname is: 138.36.238.178

rmg commented 9 years ago

@Bohmaster is there anything in the strong-pm logs? docker logs strong-pm-container should do it.

Bohmaster commented 9 years ago

@rmg

LOG: sl-pm: StrongLoop PM v4.1.1 (API v6.1.0) listening on port 8701 sl-pm: control listening on path /home/strong-pm/pmctl sl-pm: listen on 8701, work base is /home/strong-pm Request (set-size) of current (none) npm WARN package.json app@1.0.0 No license field. Run request for commit "default/npm-pack" on current (none) Start Runner: commit default/npm-pack Request (status) of current Runner: child 27 commit default/npm-pack Request {"cmd":"status"} of Runner: child 27 commit default/npm-pack Service "1" listening on 0.0.0.0:3001

My app is a simple "Hello, world" loopback app with no dependencies nor complexity. (It works perfect with the older image). This is the repo: https://github.com/Bohmaster/test

rmg commented 9 years ago

Do you have any firewall policies that need to be adjusted because of the app port changing from 3000 to 3001?

Does docker port strong-pm-container show that the ports are being published properly?

Bohmaster commented 9 years ago

It was the firewall. I've added this new rule:

Protocol Port IP
TCP 3001 to 3010 0.0.0.0/0

Now it works just fine. Thank you very very much!