orangecoding / fredy

:heart: Fredy - [F]ind [R]eal [E]states [D]amn Eas[y] - Fredy will constantly search for new listings on sites like Immoscout or Immowelt and send new results to you, so that you can focus on more important things in life ;)
http://www.orange-coding.net
MIT License
209 stars 54 forks source link

Run the application on a cloud #60

Closed fabihoe closed 2 years ago

fabihoe commented 2 years ago

I was wondering if it is possible to run the application on something like heroku

orangecoding commented 2 years ago

Sure it is. Why wouldn't it be possible? You can always run any docker image on heroku / aws or gcp... What is it you need from me on that front?

fabihoe commented 2 years ago

thank you for the reply! I'm not an expert and struggle to push a docker container, that is already successfully running locally, to heroku. Some brief instructions on the README file would be really helpful.

orangecoding commented 2 years ago

I don't think this is helpful, because then I would have to add descriptions for all cloud providers. And this is totally out of scope for Fredy.

Also a quick google search brings this up. https://devcenter.heroku.com/articles/deploying-nodejs

fabihoe commented 2 years ago

Thanks for the link. I have been trying out for hours now but it won't work. I understand that you can't add descriptions for all cloud providers but perhaps for one cloud provider of your choice?

orangecoding commented 2 years ago

but the link explains exactly what to do. if i follow it, it works like. charm.

fabihoe commented 2 years ago

I get the following error after running the last commands:

Fabians-MacBook-Pro-2:GitHub fabian$ heroku create Creating app... done, ⬢ hidden-oasis-57836 https://hidden-oasis-57836.herokuapp.com/ | https://git.heroku.com/hidden-oasis-57836.git Fabians-MacBook-Pro-2:GitHub fabian$ git push heroku main error: src refspec main does not match any error: failed to push some refs to 'https://git.heroku.com/serene-mountain-25430.git'

However, the program runs with heroku local web

fabihoe commented 2 years ago

Update: I somehow managed to push it to Heroku but it crashes after a few seconds

2022-06-15T22:07:37.750205+00:00 app[web.1]: > fredy@5.7.0 start 2022-06-15T22:07:37.750205+00:00 app[web.1]: > node index.js 2022-06-15T22:07:37.750205+00:00 app[web.1]: 2022-06-15T22:07:38.328051+00:00 app[web.1]: Started Fredy successfully. Ui can be accessed via http://localhost:9998 2022-06-15T22:07:38.329230+00:00 app[web.1]: Started API service on port 9998 2022-06-15T22:08:36.223070+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch 2022-06-15T22:08:36.308069+00:00 heroku[web.1]: Stopping process with SIGKILL 2022-06-15T22:08:36.322390+00:00 app[web.1]: Error waiting for process to terminate: No child processes 2022-06-15T22:08:36.466207+00:00 heroku[web.1]: Process exited with status 22 2022-06-15T22:08:36.578495+00:00 heroku[web.1]: State changed from starting to crashed

orangecoding commented 2 years ago

you need to bind it to a port that is actually allowed...

fabihoe commented 2 years ago

Heroku assigns ports dynamically and I can't figure out how to solve the problem. That's no easy task for people with minor experience in programming. I might have to give up unfortunately.