Serve using your own binary on Cedar, Heroku
Asked Answered
P

2

5

I am trying to run Haskell on Heroku. I have compiled a binary app and created a Procfile as follows:

web: ./app +RTS -N4

When I push it to Heroku, it says:

-----> Heroku receiving push
 !     Heroku push rejected, no Cedar-supported app detected

Now I think, Cedar does not support rolling in your binaries. Is there any way to deploy it?

I have seen https://github.com/mwotton/heroku_haskell_demo. This guy seems to have deployed to Heroku but, it no longer works. Heroku sees the Gemfiles and thinks that it is a Ruby app and runs its default Procfile with Bundle install which fails obviously.

Philologian answered 15/11, 2011 at 7:23 Comment(0)
C
4

You can deploy your Haskell app as Node.js. Cedar stack recognizes an app as Node.js by the existence of a package.json file. So, you should create a package.conf as follows:

package.json:

{ "name": "project-name", "version": "0.0.1", "dependencies": {} }
Cyclopropane answered 15/11, 2011 at 11:28 Comment(2)
Thanks! It works well. But I don not understand the logic behind it. Can you explain how this solves the problem?Philologian
I think I get it, the key is to deceive Heroku into thinking that it's a Node.js app, right?Philologian
L
3

I know that you've already solved it, but I had pretty much the same problem with an additional cause, so this might help others:

Make sure to use heroku create --stack cedar rather than heroku create.

Love answered 17/11, 2011 at 18:1 Comment(2)
Yeah, I had to tackle that problem first, which led me to this 'no cedar-supported app problem'.Philologian
Anyway, I'm facing one more problem, I compiled the code using ghc --make -static app.hs but it doesn't seem to work. It worked once and I deployed it to miku-heroku.herokuapp.com, but it's not working now.Philologian

© 2022 - 2024 — McMap. All rights reserved.