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

App not launched #4

Open
suprithwork opened this issue Feb 23, 2018 · 3 comments
Open

App not launched #4

suprithwork opened this issue Feb 23, 2018 · 3 comments

Comments

@suprithwork
Copy link

I tried to do the same process as specified using docker.

->did a docker pull
->docker-compose build
->docker-compose up
-> It shows that it is listening to a port 3000 via node mon in the console but my localhost:3000 doesnt work

Dont know why.
I did a docker inspect container id
docker inspect opencvexpress_cv_1

then I got all the network info but the host ip has no value but the host port has 3000 as value
How can I fix this issue

@suprithwork
Copy link
Author

[
{
"Id": "aeacec469c5f495077a52fe031054505c709f62298dcc861e7883d29f22f8c48",
"Created": "2018-02-23T14:58:04.26543969Z",
"Path": "nodemon",
"Args": [
"-L",
"./src/server.js"
],
"State": {
"Status": "exited",
"Running": false,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 0,
"ExitCode": 137,
"Error": "",
"StartedAt": "2018-02-23T15:09:55.350907877Z",
"FinishedAt": "2018-02-23T15:10:51.167463501Z"
},
"Image": "sha256:881c14ffc37abeb91595f4f011acfbdf3dc266e74505b6fc5c74f7b775f13196",
"ResolvConfPath": "/var/lib/docker/containers/aeacec469c5f495077a52fe031054505c709f62298dcc861e7883d29f22f8c48/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/aeacec469c5f495077a52fe031054505c709f62298dcc861e7883d29f22f8c48/hostname",
"HostsPath": "/var/lib/docker/containers/aeacec469c5f495077a52fe031054505c709f62298dcc861e7883d29f22f8c48/hosts",
"LogPath": "/var/lib/docker/containers/aeacec469c5f495077a52fe031054505c709f62298dcc861e7883d29f22f8c48/aeacec469c5f495077a52fe031054505c709f62298dcc861e7883d29f22f8c48-json.log",
"Name": "/opencvexpress_cv_1",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": [
"/Users/policendirekt/Documents/repositories/image-rec/opencv-express/src:/app/src:rw"
],
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "default",
"PortBindings": {
"3000/tcp": [
{
"HostIp": "",
"HostPort": "3001"
}
]
},
"RestartPolicy": {
"Name": "always",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": [],
"CapAdd": null,
"CapDrop": null,
"Dns": null,
"DnsOptions": null,
"DnsSearch": null,
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "shareable",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"ConsoleSize": [
0,
0
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": null,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": null,
"DeviceCgroupRules": null,
"DiskQuota": 0,
"KernelMemory": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": 0,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/5d01467e1db790f98f0a3b717b79c766b1eb3ceb27628d8e7cd88cd969569965-init/diff:/var/lib/docker/overlay2/101404b0093e47a349b9d92c42537502b68566b46224cd6af76a8cb2426edf61/diff:/var/lib/docker/overlay2/2373756dd49fcbad3677482f4b3f22926045084fb06d7aa326d5a817194a9d68/diff:/var/lib/docker/overlay2/5f178451579b01ec5c46b66e4291677f56d8f712b026d7591937dacc210bc0d6/diff:/var/lib/docker/overlay2/6867e8e19fc298184a6fb17f854a10e4d0c337e3578a5c79f4200733b4838107/diff:/var/lib/docker/overlay2/d6819a611cdf17942e6c39625ce841d4fbe44fa10f9d55aa5a6945949e6f46dd/diff:/var/lib/docker/overlay2/0a177e4afd6e7de62e7404c9d61dba0b6c342df1d0fcd745bdc3f441c144eb95/diff:/var/lib/docker/overlay2/b950e0126e34346c53bfc8a8b5973829ce3328342fc627dddaf9374fd28e321b/diff:/var/lib/docker/overlay2/c43622c7c61bcb9928051d153f9b4c2b7dc1777ccc7505113b3afd4c313204be/diff:/var/lib/docker/overlay2/5ea003e8f7f50c8ff704cbed52fd8c4f38a33491981e38c9eb8d1e5b395dbbf7/diff:/var/lib/docker/overlay2/3c3c10683ff3d15ffcc0c7221dcca159a9786b8ebde74b3b5fe76b1dceea4ecf/diff:/var/lib/docker/overlay2/01fa68b710ebaf5086ef7512280e54c65588a511c15a10fc97c6700ce86b82f6/diff",
"MergedDir": "/var/lib/docker/overlay2/5d01467e1db790f98f0a3b717b79c766b1eb3ceb27628d8e7cd88cd969569965/merged",
"UpperDir": "/var/lib/docker/overlay2/5d01467e1db790f98f0a3b717b79c766b1eb3ceb27628d8e7cd88cd969569965/diff",
"WorkDir": "/var/lib/docker/overlay2/5d01467e1db790f98f0a3b717b79c766b1eb3ceb27628d8e7cd88cd969569965/work"
},
"Name": "overlay2"
},
"Mounts": [
{
"Type": "bind",
"Source": "/Users/policendirekt/Documents/repositories/image-rec/opencv-express/src",
"Destination": "/app/src",
"Mode": "rw",
"RW": true,
"Propagation": "rprivate"
}
],
"Config": {
"Hostname": "aeacec469c5f",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"3000/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Cmd": [
"nodemon",
"-L",
"./src/server.js"
],
"ArgsEscaped": true,
"Image": "opencvexpress_cv",
"Volumes": {
"/app/src": {}
},
"WorkingDir": "/app",
"Entrypoint": null,
"OnBuild": null,
"Labels": {
"com.docker.compose.config-hash": "a566aff373f6fefec574998a8a903ae59fb2086d73e6b4be9801c59d7daa44f3",
"com.docker.compose.container-number": "1",
"com.docker.compose.oneoff": "False",
"com.docker.compose.project": "opencvexpress",
"com.docker.compose.service": "cv",
"com.docker.compose.version": "1.18.0"
}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "86f05cdb1ae15c072ee4bed224068ba619762256cbdf3de8739cdd2b5b117b23",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {},
"SandboxKey": "/var/run/docker/netns/86f05cdb1ae1",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "8a378f6906c4149ad9cdbebbab266aa0963b48b727da8250f869116eeada96d5",
"EndpointID": "",
"Gateway": "",
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "",
"DriverOpts": null
}
}
}
}
]

The above is the obtained data on the console for a docker inspect container id command

@justadudewhohacks
Copy link
Owner

Hi,

Shouldn't you be connecting to the IP of your docker machine instead of localhost? Check docker-machine ls to get the IP.

@hanalice
Copy link

hanalice commented May 9, 2018

exec docker-compose ps command , select the port of the host machine instead of the docker machine ip. Mine is host 3001 port forward to docker container 3000 port.

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

3 participants