發表文章

目前顯示的是 4月, 2022的文章

A Journey To Deploy Project-M36 On Heroku ( Or To Get Rid Of GHC!)

updated: Here is the complete recipe including deployment script . In the beginning, I tried  Using Nix to deploy a Haskell web app to Heroku . A good, simple example. But I got a R10 error. Why is my Node.js app crashing with an R10 error? The point is that heroku uses $PORT and 0.0.0.0 inside. Otherwise you get `Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch` So the modification of websocket-server.hs But the image is too big. There is a dependency of ghc, about 3GB. The deployment is slow. So first, I tried `nixpkgs.haskell.lib.justStaticExecutables`. ghc is still there. `nix why-depends` and `nix-tree` shows dependencies and why.  So I need static haskell executables. Luckily, there is  static-haskell-nix  to create static executables. I add `dontStrip = false;` in my project-m36.nix. (dontStrip doesn't has effect either.) Nix: Propagate dependency for build-time but NOT for run-time?  points out the necessity of `removeReferences