dunglas / mercure

🪽 An open, easy, fast, reliable and battery-efficient solution for real-time communications
https://mercure.rocks
GNU Affero General Public License v3.0
3.98k stars 296 forks source link

How to deploy Mercure Hub on Heroku? #524

Closed DhiaDjobbi closed 3 years ago

DhiaDjobbi commented 3 years ago

Hello guys , I am really struggling to deploy Mercure Hub on Heroku! I made some research and I found Dunglas Answer on StackOverflow But its not clear :( ! Do I create an empty Go Project and then Copy and Paste the Binary inside it and push it to Heroku ? and what Procfile Should I use on this case? The go lang Default Procfile web: bin/go-getting-started ? or Mercure Procfile ? web: ADDR=":${PORT}" mercure ? In case Mercure Procfile , Which Port should I use ?

Can Anyone please Provide clear steps on deploying Mercure on Heroku! Thank you

ging-dev commented 3 years ago

Hello guys , I am really struggling to deploy Mercure Hub on Heroku! I made some research and I found Dunglas Answer on StackOverflow But its not clear :( ! Do I create an empty Go Project and then Copy and Paste the Binary inside it and push it to Heroku ? and what Procfile Should I use on this case? The go lang Default Procfile web: bin/go-getting-started ? or Mercure Procfile ? web: ADDR=":${PORT}" mercure ? In case Mercure Procfile , Which Port should I use ?

Can Anyone please Provide clear steps on deploying Mercure on Heroku! Thank you

Hey man, i think this will help you: https://github.com/ging-dev/mercure-heroku You need use this buildpack to run it: https://github.com/ph3nx/heroku-binary-buildpack Demo: https://mercure-gingdev.herokuapp.com

DhiaDjobbi commented 3 years ago

Thank you @ging-dev for your answer! I created a heroku project and used that binary buildpack using: heroku create mercure-dhia --buildpack https://github.com/ph3nx/heroku-binary-buildpack.git

I added Mercure files (I am using version 0.9.0) and I git add. git commit and then git push heroku master when I open https://mercure-dhia.herokuapp.com/ I get a Permission Denied Error on my logs.

This are my logs : image

I solved this error by Changing my Procfile content from : web: ./mercure -k "test" -c '*' -p '*' -a :$PORT -D -X to : web: chmod a+x ./mercure ; ./mercure -k "test" -c '*' -p '*' -a :$PORT -D -X (I added **chmod a+x ./mercure ;** )

ging-dev commented 3 years ago

Thank you @ging-dev for your answer! I created a heroku project and used that binary buildpack using: heroku create mercure-dhia --buildpack https://github.com/ph3nx/heroku-binary-buildpack.git

I added Mercure files (I am using version 0.9.0) and I git add. git commit and then git push heroku master when I open https://mercure-dhia.herokuapp.com/ I get a Permission Denied Error on my logs.

This are my logs : image

I solved this error by Changing my Procfile content from : web: ./mercure -k "test" -c '*' -p '*' -a :$PORT -D -X to : web: chmod a+x ./mercure ; ./mercure -k "test" -c '*' -p '*' -a :$PORT -D -X (I added **chmod a+x ./mercure ;** )

Ya, exactly I gave the file permission before adding it to git, I don't have that problem 😳

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

samijnih commented 3 years ago

@ging-dev @DhiaDjobbi Hi guys

Which version of mercure bin do you use? I'm using the latest one and there's no way to specify options. I can only do "mercure run -config" specifying a caddy file.

So I assume that Mercure must be run with Caddy on Heroku now?

Thanks for your help

ging-dev commented 3 years ago

@ging-dev @DhiaDjobbi Hi guys

Which version of mercure bin do you use? I'm using the latest one and there's no way to specify options. I can only do "mercure run -config" specifying a caddy file.

So I assume that Mercure must be run with Caddy on Heroku now?

Thanks for your help

Hi, you can choose legacy linux x86_64 version to run on Heroku, they don't need Candy server

https://github.com/dunglas/mercure/releases

samijnih commented 3 years ago

@ging-dev @DhiaDjobbi Hi guys Which version of mercure bin do you use? I'm using the latest one and there's no way to specify options. I can only do "mercure run -config" specifying a caddy file. So I assume that Mercure must be run with Caddy on Heroku now? Thanks for your help

Hi, you can choose legacy linux x86_64 version to run on Heroku, they don't need Candy server

https://github.com/dunglas/mercure/releases

Thank you!