m3ng9i/ran

Doesn't work on Heroku

aluedtke7 opened this issue · 2 comments

Hi,

I wanted to replace my own tiny GO Http server with ran. Unfortunately, I can't get it working on heroku. Ran works nicely on my local Ubuntu 20.04 machine. I found two problems, the first one I could help myself and the second one is still unresolved.

Problem 1: ran doesn't work in an alpine container. I needed to recompile the sources with the command line

CGO_ENABLED=0 go build .

Problem 2: now that this new ran binary works in an alpine container, I deployed it to Heroku, but I get the following log messages:

heroku[web.1]: Starting process with command `/ran -r /web -p \$\{PORT\} -b 0.0.0.0`
app[web.1]: 2020-07-15 17:52:27.117366 INFO: System: Ran is running on HTTP port 5101
app[web.1]: 2020-07-15 17:52:27.117370 INFO: System: Listening on http://0.0.0.0:5101
heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
heroku[web.1]: Stopping process with SIGKILL
eroku[web.1]: Process exited with status 137

My Dockerfile is as follows:

FROM alpine
COPY ran/ran /ran
WORKDIR /web
COPY dist /web
ENTRYPOINT [ "/ran", "-r", "/web", "-p", "${PORT}", "-b", "0.0.0.0" ]

The ${PORT} is neccessary, because Heroku is setting this env var each time to a different port number.

I know that it's important to use "0.0.0.0" instead of "localhost" and you have to use the given port. Both settings are correct from my point of view.

Do you have an idea, why Heroku can't access ran?

Best regards

Sorry, I haven't used heroku. I did some searching, but didn't find a solution for your problem.

Thanks for searching! Meanwhile I'm using nginx on Heroku.