So just checking that your Docker file looks like something like
FROM rails:onbuild
EXPOSE 3000
MAINTAINER mccabe615
ADD script/start /start
RUN chmod a+x /start
USER root
ENV RAILS_ENV development
CMD /start
Because it looks to me like the app is not copied into the container, i not sure how the original author intended this to work, as it appears like you need to mount the source into this container for this to work. but even then the start script won’t work as it looking for things that won’t be in the same place
Simple test would be to jump inside your container and see if the application is actually running. but using the command docker exec -it goat /bin/bash I suspect your container is starting up then shutting down as it doesn’t have any application to run.
does copy the app (The build will COPY . /usr/src/app, RUN bundle install, EXPOSE 3000, and set the default command to rails server.)
Indeed the build runs fine, and when running the container, I can see that the app has started.
It’s looks like something’s blocking the access to container’s 3000 port. I’m trying to understand, any suggestions are welcome
Ok learnt something new about the rails docker container! Awesome.
No sure if @siddharth67 suggestion considered that you are already exposing the port on your host using the -p flag.
Having a bit more a poke around the github repo i noticed by default the app starts up listening on 127.0.0.1:3000, since it’s not listening on the interface exposed in the container it will never get and traffic set to it from the host. if you change this to 0.0.0.0:3000 i think everything will work as you expect