The Sinatra web app I created works inside the container and I am able to access it at 9393
within the container. Following is my Dockerfile
(which uses the image specified by the Dockerfile
: jikkujose/red):
FROM jikkujose/red
MAINTAINER Jikku Jose <jikkujose@gmail.com>
COPY . /banana_app
WORKDIR /banana_app
RUN bundle install
EXPOSE 9393
ENTRYPOINT ["bundle", "exec", "shotgun"]
I launched the built image by, docker run -itdP hey
When I do, docker ps -a
:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a815e2852c68 hey "bundle exec shotgun 13 minutes ago Up 13 minutes 0.0.0.0:32783->9393/tcp cranky_rosalind
When I do, curl -v 'http://localhost:32783'
:
* Rebuilt URL to: http://localhost:32783/
* Hostname was NOT found in DNS cache
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 32783 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:32783
> Accept: */*
>
* Empty reply from server
* Connection #0 to host localhost left intact
curl: (52) Empty reply from server
PS: I have specified to bind the app to 0.0.0.0
.
What am I missing? Why can't I access the app at the host too?