I am using the Gorilla framework in Go to expose a webservice. I have a "Hello World" endpoint at /hello
which works fine when hit from Postman, browser or curl
.
The problem arises when I bundle it with Docker. My Dockerfile is as below
FROM alpine
COPY ./target/himer-users-go /app
ENV PORT 9000
RUN echo $PORT
ENTRYPOINT /app
EXPOSE ${PORT}
Now I can ssh
into the container and ping the server using wget
(since alpine
doesn't come bundled with curl
)
But when I run the image like
docker run -d -p 9000:9000 namespace/image
I can't access the server in any way from my host system.
Any help would be greatly appreciated.