Code Monkey home page Code Monkey logo

Comments (7)

meatherly avatar meatherly commented on June 17, 2024

Heroku kills web apps if they don't respond to $PORT in 60 seconds. see: https://devcenter.heroku.com/articles/error-codes#r10-boot-timeout

I would just write a simple cowboy process that listens to and set to port to System.get_env('PORT') || 4000

This is all you need to add: https://github.com/joshrotenberg/elixir_cowboy_examples/tree/master/apps/hello_world

Just change the port.

That should work.

from hedwig.

docteurklein avatar docteurklein commented on June 17, 2024

@meatherly thanks for the tips!
I know about the "web" process specificities, but it amazes me that heroku forces you to create a useless web process just to let other dynos live.

From what I read here https://devcenter.heroku.com/articles/run-non-web-java-processes-on-heroku it seems we could run whatever long-running process without any web process.

Thoughts?

from hedwig.

bbrock25 avatar bbrock25 commented on June 17, 2024

@docteurklein is there a reason why you cannot use a worker process? I have an elixir chat bot running as a worker on heroku that has stayed alive for months now without a web process.

My Procfile:

worker: mix run --no-halt

This is not a hedwig app, but I cannot imagine that deploying to heroku would be much different.

from hedwig.

docteurklein avatar docteurklein commented on June 17, 2024

@bbrock25 thanks for the feedback
I tried at first to define a worker process only, but didn't get it to work.
What does your Procfile look like, and how are you starting it?
I tried with

bot: mix run --no-halt

and then push to deploy.

from hedwig.

docteurklein avatar docteurklein commented on June 17, 2024

EDIT: i just tried to run it with heroku scale bot=1 and it seems to work. Still not sure why it doesn't at git push.

from hedwig.

bbrock25 avatar bbrock25 commented on June 17, 2024

You probably needed to turn the worker on before it would automatically deploy. I'd imagine that deploying with git push should be fine now.

from hedwig.

docteurklein avatar docteurklein commented on June 17, 2024

@bbrock25 thanks!
I didn't notice you added your Procfile, sorry to ask again how it looked like.
Anyway, I guess I can close this issue now?

from hedwig.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.