Live data from Hacker News

A tiny Docker image to serve static websites

lipanski.com

41–50 of 156 posts

Re: A tiny Docker image to serve static websites

#41

Redbean is just 155Kb without the need for alpine or any other dependency. You just copy the Redbean binary and your static assets, no complicated build steps and hundred MB download necessary. Check it out: https://github.com/kissgyorgy/redbean-docker

There's also the 6kB container, which uses asmttpd, a webserver written in assembler.

https://devopsdirective.com/posts/2021/04/tiny-container-ima...

Re: A tiny Docker image to serve static websites

#42

Earlier quoted context omitted.

Is that coming back with a HTTP 200 response though and the made up HTML page? That doesn't seem right... at least, I dunno if google and such would actually index your page at the new URL vs. just thinking "huh weird looks like blog.eowyn.net is now called '301 Moved Permanently', better trash that down in the rankings".

It shows up as a proper 301 when I load up the URL in Firefox. The question is, how?

Wow, nice yeah I'd love to know how github supports configuring a URL to 301 redirect!

Re: A tiny Docker image to serve static websites

#44

Earlier quoted context omitted.

Is that coming back with a HTTP 200 response though and the made up HTML page? That doesn't seem right... at least, I dunno if google and such would actually index your page at the new URL vs. just thinking "huh weird looks like blog.eowyn.net is now called '301 Moved Permanently', better trash that down in the rankings".

It shows up as a proper 301 when I load up the URL in Firefox. The question is, how?

One of the Jekyll plugins that GH Pages supports[0] is jekyll-redirect-from, which lets you put a `redirect_to` entry in a page's front matter.

[0]: https://pages.github.com/versions/

Re: A tiny Docker image to serve static websites

#45
post #38

Earlier quoted context omitted.

And you're welcome to think so, but if you intend to make a case for removing Docker as optimization, you still have yet to start.

I am arguing against Docker for maintainability reasons, not CPU cycles. Relying on hidden complexity makes for a hard path ahead. You become bound by Docker's decisions to change in the future. For example, SSLPing's reliance on a lot of complex software (among which NodeJS and Docker) got it to close, and it got on the front page of HN recently. https://sslping.com/ https://news.ycombinator.com/item?id=30985514 Kee…

Docker Swarm isn't Docker; it's an orchestration service on top of Docker, that happens to have originated with the same organization that Docker does - hence the name. A few years ago Swarm looked like it might be competitive in the container orchestration space, but then Kubernetes got easy to use even for the small deployments Swarm also targeted, and Swarm has withered since. It wouldn't be impossible or probably even all that difficult to switch over to k8s if that were the only blocker, but as the sunset post notes and you here ignore, that wasn't the only or the worst problem facing SSLping - as, again, the sunset post notes to your apparent disinterest, it's been losing money for quite a while before it fell apart.

(Has it occurred to you that it losing money for a while might have contributed to its eventual unmaintainability, as the dev opted sensibly to work on more sustainably remunerative projects? If so, why ignore it? If not, why not?)

Similarly for the Node aspect - that's very much a corner use case related to this specific application (normally SSLv3 support is something you actively don't want!), and not something that can fairly be generalized into an indictment of Node overall. Not that it's a surprise to see anyone unjustly indict Node on the basis of an unsupportable generalization from a corner case! But that it's unsurprising constitutes no excuse.

Other than that you seem here to rely on truisms, with no apparent effort to demonstrate how they apply in the context of the argument at which you gesture. And even the truisms are misapplied! Avoiding dependencies for the sake of avoiding dependencies produces unmaintainable software because you and your team are responsible for every aspect of everything, and that can work for a team of Adderall-chomping geniuses, but also only works for a team of Adderall-chomping geniuses. Good for you if you can arrange that, but it's quite absurd to imagine that generalizes or scales.

Re: A tiny Docker image to serve static websites

#46
post #8

Earlier quoted context omitted.

Wouldn't removing Docker entirely be a good optimization?

Docker adds other value to the lifecycle of your deployment. An "optimization" where you're removing value is just a compromise. Otherwise we'd all run our static sites on UEFI.

What value is that, for running such a simple piece of software?

Re: A tiny Docker image to serve static websites

#47
post #23

For static websites, is there any reason not to host them on GitHub? Since GitHub Pages lets you attach a custom domain, it seems like the perfect choice. I would expect their CDN to be pretty awesome. And updating the website with a simple git push seems convenient.

>For static websites, is there any reason not to host them on GitHub?

One reason would be if your site violates the TOS or acceptable use policy. GitHub bans "excessive bandwidth" without defining what that is for example. For a small blog about technology you are probably fine.

Re: A tiny Docker image to serve static websites

#48
While this is remarkably a good hack and I did learn quite a bit after reading the post, I'm simply curious about the motivation behind it? A docker image even if it's a few MBs with Caddy/NGINX should ideally be just pulled once on the host and sit there cached. Assuming this is OP's personal server and there's not much churn, this image could be in the cache forever until the new tag is pushed/pulled. So, from a "hack" perspective, I totally get it, but from a bit more pragmatic POV, I'm not quite sure.

Re: A tiny Docker image to serve static websites

#49
post #11

Earlier quoted context omitted.

And it does https/tls, where thttpd does not.

I'm confused how the author considers thttpd more 'battle tested' if it doesn't resolve https. Either way though, it's a great article I'm glad the author took to write. His docker practices are wonderful, wish more engineers would use them.

"Battle tested" typically means that the code has been running for a long time, bugs found, bugs squashed, and a stability has been attained for a long time. It's usage predates the "information wars", back when we really didn't think about security that much because nothing was connected to anything else that went outside the companies, so there were no hackers or security battles back then. So I suspect this is the authors frame of reference.

Re: A tiny Docker image to serve static websites

#50
post #23

For static websites, is there any reason not to host them on GitHub? Since GitHub Pages lets you attach a custom domain, it seems like the perfect choice. I would expect their CDN to be pretty awesome. And updating the website with a simple git push seems convenient.

> is there any reason not to host them on GitHub?

Because some people may not want to depend even more on Big Tech (i.e. Microsoft) than they already do

Post reply on HN