0

I am on Ubuntu 14.04 and using docker to run Play Framework application in Java. The tool used to automate the build is ingensi-play-framework.

The command to start the application within docker is

docker run -d -v /path/to/play/project:/app:rw -P ingensi/play-framework 

taken from the above link. After this, when I run docker ps, I get this:

CONTAINER ID        IMAGE                    COMMAND                  CREATED             STATUS              PORTS                                              NAMES
3eb2285118dc        ingensi/play-framework   "activator run"          14 minutes ago      Up 14 minutes       0.0.0.0:32785->8888/tcp, 0.0.0.0:32784->9000/tcp   hungry_hopper

and I hit localhost:32784, I get the message

This webpage is not available

ERR_CONNECTION_RESET

on Google Chrome. I searched on the Internet but to no avail. Please help.

ajay
  • 9,402
  • 8
  • 44
  • 71
  • Check your server log via `docker logs hungry_hopper` ("hungry_hopper" is from your ps command, if you start again you might get a different name) to say where goes wrong. It seems your service is not started correctly within docker. – waterscar Feb 19 '16 at 09:16

2 Answers2

1

Try to publish the specific port of your application, from the container, to the host. See the -p option of the docker run command.

For example, if you want to expose on the same port on localhost (considering this port is not already used), your command becomes:

docker run -d -v /path/to/play/project:/app:rw -p 9000:9000 ingensi/play-framework 
Emil Salageanu
  • 997
  • 1
  • 10
  • 24
  • Your application is not started inside the container or not listening on that port. You should check the container logs. – Emil Salageanu Feb 17 '16 at 16:07
  • You can run a bash inside the container (run docker exec -i -t container_id bash) and inside, check if your application is listening by running telnet localhost 9000 – Emil Salageanu Feb 17 '16 at 16:15
0

try to type http://0.0.0.0:9000 on your web browser, it works for me.

edkepex
  • 31
  • 2