Accessing theia externally

Can you access the IDE externally (that is, not localhost)? setting a host:container port and exposing it yields no result.
Running in docker.

[original thread by AssertLife]

[shortwavedave]

What is the full docker command you are using

[shortwavedave]

you should be able to grab the ip address of your machine and access it - are you using linux?

[AssertLife]

sudo docker run -it --init -p 3000:3000 --expose 9229 -p 9229:9229 -v “$(pwd):/home/project:cached” theiaide/theia:next --inspect=0.0.0.0:9229

should I expose port 3000?

[AssertLife]

Using linux debian version 9

[shortwavedave]

I don’t think the “expose” should matter

[shortwavedave]

so how are you testing it - like how do you know you can’t access the IDE externally

[shortwavedave]

the -p 3000:3000 should map the port on your local machine to the docker machine. if you run for example, netstat -a, you should see that your machine is listening on that port. then grab your ip address from ifconfig

[AssertLife]

tcp6 0 0 [::]:33060 [::]: LISTEN
tcp6 0 0 [::]:9229 [::]:
LISTEN

[AssertLife]

tcp6 0 0 [::]:3000 [::]:* LISTEN

[AssertLife]

Clearly the ports are open. perhaps Google Cloud Platform blocks my ports?

[AssertLife]

Works now

[shortwavedave]

oh yes, on gcloud for sure

[shortwavedave]

it’s blocked

[shortwavedave]

you could just setup an nginx server and proxy it to port 3000

[shortwavedave]

In your nginx conf set the location something like this:
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection ‘upgrade’;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}

[shortwavedave]

there are tutorials abound

[shortwavedave]

I guess you could also setup the port as 3000:80

[shortwavedave]

in the docker run command

[AssertLife]

I worked it out… no need for nginx server…
I had an Ephemeral IP address and not static, causing my domain to point at the wrong IP
(pbb happens when you change ports etc)