Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work on Heroku #28

Closed
aluedtke7 opened this issue Jul 15, 2020 · 2 comments
Closed

Doesn't work on Heroku #28

aluedtke7 opened this issue Jul 15, 2020 · 2 comments

Comments

@aluedtke7
Copy link

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

@m3ng9i
Copy link
Owner

m3ng9i commented Jul 22, 2020

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

@aluedtke7
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants