from Hacker News

Deploying a ReasonML React app with Docker

by anirudhmurali on 2/6/18, 7:34 AM with 43 comments

  • by Kwastie on 2/6/18, 11:35 AM

    With pure Reason (No JS bindings) it should be possible to skip Node / Bucklescript on the server and compile straight to binary.

    This should be possible with something like bsb-native (https://github.com/bsansouci/bsb-native)

    I haven't tried this because I don't have a pure Reason project

  • by anirudhmurali on 2/6/18, 9:36 AM

  • by theptip on 2/6/18, 3:46 PM

    One annoying thing you'll need to add before this is production-ready is configurable environment config, so that you can deploy the same container for your staging vs. production version of the app.

    I use a `patch.sh` as the ENTRYPOINT, which says something like

      echo $API_URL >> /usr/local/nginx/html/config.js
      echo $OTHER_CONFIG > /usr/local/nginx/html/config.js
      ...
      exec nginx
    
    Though there may be other ways to achieve this as well.
  • by azr79 on 2/6/18, 10:11 AM

    What can ReasonML do that TypeScript can't?
  • by jmcomets on 2/6/18, 1:53 PM

    Unrelated, but does anyone know what font/colorscheme are used in the screenshots? I find it very slick for code presentation.
  • by tuananh on 2/6/18, 9:00 AM

    since we use bs to compile, shouldn't we use a node image to compile and then copy them over to runtime image later?