1. 9
  1.  

  2. 6

    I considered doing this with a Rust web server. Then I discovered that nginx is around 1.1MiB installed and decided it was best just to use that for its features, performance, and production hardening.

    # apk info -s nginx
    nginx-1.16.0-r2 installed size:
    1187840
    
    1. 2

      And I think it was the right decision.

      Every time I tried to use one of these static website servers, it seemed like a good idea at first. Run one command and the website is served, brilliant.

      The trouble is that most of the cases you don’t want just a static website. Maybe you want to add redirects. Proxy a path to an end-point. Or add special headers on the response (CORS, CSP). Maybe one end-point needs a bit of dynamic results after all. Just a tiny bit of template rendering. Does the server support TLS and HTTP/2?

      Nginx doesn’t have the nicest configuration language but it does all of these things and more. I much prefer to start with it than have to switch servers mid-project.

    2. 2

      If applications need to specifically target docker for ease of use with it, doesn’t it mean docker failed to live up to its promise? ;)

      1. 2

        I think “built for Docker” really just means “we made a Dockerfile, send logs to stdout in a reasonable manner, and tried to keep the distribution size small”. It also implies that the application doesn’t require direct interaction with certain kernel features or modification of network interfaces, but web servers shouldn’t be doing that anyway.

        Nginx could claim that they’re “made for Docker” to an equal degree.

        1. 1

          If applications specifically need to target Linux for ease of use with it, doesn’t it mean Linux failed up to live to its promise of POSIX compatibility? ;)

          1. 2

            While that was tongue in cheek, I seriously do think Docker is not nearly as “easy and just works” solution as its proponents claim.

            Since when programs need to specifically target Linux? I’m still to see a program that uses only fully standardized POSIX APIs and fails to work.

        2. 1

          Name reminded me of my good old static site-gen https://github.com/metaleap/haxtatic =)

          1. 1

            I’m glad I’m not the only one bothered by the tyranny of markdown. I’m taking that ideas futher in https://baturin.org/projects/soupault that has no templates and no front matter either, and instead extracts the metadata directly from HTML.