Mojo::Server::Morbo

41 views
Skip to first unread message

verenceLola

unread,
Aug 14, 2019, 7:10:38 AM8/14/19
to Mojolicious
Hello, 
I've been trying to dockernize my Mojolicious app lately and I'm running into issues.
When I publish the application's port on the docker host the server is returning an empty response. This however works when I use hyponotoad server. 
I've tried the example on your Github gist and its working okay. Is there something that I'm missing. Here is the Dockerfile.
FROM perl:latest
LABEL MAITAINER 'Vincent Onyango' 'veren...@icloud.com'
LABEL APPLICATION 'API Gateway'
VOLUME [ "/application" ]
COPY cpanfile cpanfile
COPY cpanfile.snapshot cpanfile.snapshot
RUN curl -L https://cpanmin.us | perl - App::cpanminus
RUN cpanm -qn --installdeps .
WORKDIR /application
ENV MOJO_LISTEN=http://127.0.0.1:8080
EXPOSE 8080
ENTRYPOINT [ "/usr/local/bin/morbo","-v", "script/api_gateway" ]

I'm mounting my code I created using Morbo generate cammand.  using this 
`docker run --name app -d -p 8080:8080 -v $PWD/<app_name>:/application <image_name>`

Kindly assist anyone

Veesh Goldman

unread,
Aug 14, 2019, 11:14:55 AM8/14/19
to mojol...@googlegroups.com
Morbo listens on port 3000 by default. Have you tried using '-l http://*:8080'?

--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mojolicious/4f1a1c93-b5e6-4d9c-bcf5-e547f1e5387d%40googlegroups.com.

Veesh Goldman

unread,
Aug 14, 2019, 11:19:38 AM8/14/19
to mojol...@googlegroups.com
Sorry, I missed the line where you set the environment variable.

Tekki

unread,
Aug 15, 2019, 2:32:09 AM8/15/19
to Mojolicious
Morbo should listen to http://*:8080, not 127.0.0.1:8080. 127.0.0.1 is localhost inside the container.

Am Mittwoch, 14. August 2019 13:10:38 UTC+2 schrieb verenceLola:
ENV MOJO_LISTEN=http://127.0.0.1:8080

Reply all
Reply to author
Forward
0 new messages