RocketChat / Docker.Official.Image

Docker hub - community managed image
305 stars 215 forks source link

Unable to access rocket.chat from localhost after deployment #18

Closed jameshowe closed 6 years ago

jameshowe commented 8 years ago

Ran through the example steps on Mac OSX El Capitan for the port forwarding but I can't seem to access it via http://localhost.

Here's the relevant config:

...
        "HostConfig": {
            ...
            "NetworkMode": "default",
            "PortBindings": {
                "3000/tcp": [
                    {
                        "HostIp": "",
                        "HostPort": "80"
                    }
                ]
            },
...
        "Config": {
            "Hostname": "444eb6448532",
            "Domainname": "",
            "User": "rocket chat"
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "3000/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "ROOT_URL=http://localhost",
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "NODE_VERSION=0.10.43",
                "NPM_VERSION=2.14.1",
                "RC_VERSION=0.22.0",
                "MONGO_URL=mongodb://db:27017/meteor",
                "PORT=3000",
                "Accounts_AvatarStorePath=/app/uploads"
            ],
            "Cmd": [
                "node",
                "main.js"
            ],
            "Image": "rocket.chat",
            "Volumes": {
                "/app/uploads": {}
            },
            "WorkingDir": "/app/bundle",
            "Entrypoint": null,
            "OnBuild": null,
            "Labels": {},
            "StopSignal": "SIGTERM"
        },
...
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "xxx",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {
                "3000/tcp": [
                    {
                        "HostIp": "0.0.0.0",
                        "HostPort": "80"
                    }
                ]
            },
            "SandboxKey": "/var/run/docker/netns/64a4892b7bb4",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "xxx",
            "Gateway": "172.17.0.1",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "172.17.0.3",
            "IPPrefixLen": 16,
            "IPv6Gateway": "",
            "MacAddress": "xx:xx:xx:xx:xx:xx",
            "Networks": {
                "bridge": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "xxx",
                    "EndpointID": "xxx",
                    "Gateway": "172.17.0.1",
                    "IPAddress": "172.17.0.3",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "xx:xx:xx:xx:xx:xx"
                }
            }
        }

Tried access 172.17.0.3 as well but no luck :(

The containers appear to be running, docker ps shows me:

CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                  NAMES
444eb6448532        rocket.chat         "node main.js"           About an hour ago   Up About an hour    0.0.0.0:80->3000/tcp   rocket chat
d8673a449356        mongo               "/entrypoint.sh --sma"   About an hour ago   Up About an hour    27017/tcp              db
pierreozoux commented 8 years ago

Can you give the docker command you issue, and also the error you get?

Thanks!

jameshowe commented 8 years ago

@pierreozoux I'm just running the command from the docs, so in order:

docker run --name db -d mongo --smallfiles
docker run --name rocketchat -p 80:3000 --env ROOT_URL=http://localhost --link db -d rocket.chat

No errors, containers are active just can't access rocket.chat from localhost afterwards as the docs suggest.

apenvern commented 8 years ago

Hello, I have the same issue than @jameshowe I don't have errors in containers Thanks

apenvern commented 8 years ago

It works on Windows. I'll retry on Ubuntu. Another thing I can't change the configuration "env" (ie --env ROOT_URL=http://hostname:port) after the first start of the container. I have to stop and remove the mongo container to reset all configurations.

Tek42 commented 8 years ago

Any updates on this issue ? I also cannot access RocketChat from localhost of from the port forwarding.

tianon commented 8 years ago

On Mac OS X, if you're using docker-machine+boot2docker (the default for Docker Toolbox), you'll need to hit docker-machine ip instead of localhost. If you get access to the Docker for Mac Beta, that restriction goes away and the tooling sets up the necessary forwarding.

I've just verified myself that there isn't a problem with the image (by launching a mongo container, then a rocket.chat linked container, and connecting successfully to the rocket.chat container from my browser).

HorlogeSkynet commented 6 years ago

Hi,

I feel so confused for digging up this issue, but there are the facts :

Any help would be appreciated :ok_hand: I may be able to run some tests if needed !

Thanks ! Bye

EDIT : Our problem looks definitely related to firewall rules, but can't figure why the entries correctly added by Docker are not sufficient to allow a simple connection as above...

EDIT 2 : This was definitely not related to firewall rules, as all other tested containers work well. I think it's rather a IPv6 / IPv4 binding problem when assigned to localhost. Hope it helped someone wandering by the surroundings...

pierreozoux commented 6 years ago

@HorlogeSkynet If you need support, the best is to ask on the community chat.

I'll close this issue for now.