Live data from Hacker News

A tiny Docker image to serve static websites

lipanski.com

101–110 of 156 posts

Re: A tiny Docker image to serve static websites

#101

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?

For the latter, `https://blog.eowyn.net/vhdlref" />` in the ``

Re: A tiny Docker image to serve static websites

#102

Earlier quoted context omitted.

I’m not suggesting it has value to everyone. I’m suggesting it has value to the people who see value in it.

I'm super curious to know what the value to people who see that happens to be. It's serving static websites, why do I need to wrap THAT of all things in a container? Really, enlighten me

Once you've gone the container route you no longer even need to think about virtual servers. You can just deploy it to a container service, like ECS.

Re: A tiny Docker image to serve static websites

#103

Earlier quoted context omitted.

A few off the top of my head. The ability to pull the image on to any machine without needing to clone the source files and build it. Smaller images mean faster pod starts when you auto scale.

You have to login to some docker repository anyways and know the series of commands to actually run it. Cloning a repo and running a shell script is probably a lot easier and faster than that. What kind of work are you doing that requires really fast auto scaling? Is a few minutes to spin up a new instance really that cumbersome? Can you not signal for it to spin up a new instance a tiny bit earlier than when it's ne…

> You have to login to some docker repository anyways and know the series of commands to actually run it. Cloning a repo and running a shell script is probably a lot easier and faster than that.

In isolation, yes. But if, for instance, you're already running a container orchestration tool with hundreds of containers, and have CI/CD pipelines already set up to do all of that, it's easier just to tack on another container.

Re: A tiny Docker image to serve static websites

#104

But why would you prefer Docker like this over, for example, running thttpd directly? Saves you a lot of Ram an indirection?

For one, because his home server provides multiple utilities, not just this one project, and without docker he starts to have dependency conflicts. He also like to upgrade that server close to edge, and if that goes south, he want to rebuild and bring his static site up quickly, along with his other projects.

Well in the article he ended up compiling thttpd statically so he wouldn't have dependency conflicts if he ran it directly. Funny how there's overlap in docker solutions that solve different but related issues for non-docker deploys as well...

Re: A tiny Docker image to serve static websites

#105

But why would you prefer Docker like this over, for example, running thttpd directly? Saves you a lot of Ram an indirection?

For one, because his home server provides multiple utilities, not just this one project, and without docker he starts to have dependency conflicts. He also like to upgrade that server close to edge, and if that goes south, he want to rebuild and bring his static site up quickly, along with his other projects.

I serve several sites off an AWS EC2 instance, all are dynamic REST endpoints with DBs in their own `tmux` instance. I also have a five line nodeJS process running on another port for just my static page. All of this is redirected from AWS/r53/ELB. The only pain in the arse is setting up all the different ports, but everything runs in its own directory so there are no dependency issues. I've tried to ramp up with docker, but I always end up finding it faster to just hack out a solution like this (plus it saves disk space and memory on my local dev machine). In the end my sol'n is still a hack since every site is on one machine, but these are just sites for my own fun. Perhaps running containers directly would be easier, but I haven't figured out how to deal with disk space (since I upload lots of stuff).

Re: A tiny Docker image to serve static websites

#106

Earlier quoted context omitted.

The less resources you use from your system, the more things you can do with your system.

Only matters if you're actually using those extra cycles or not. The majority of web servers hover at <10% CPU just waiting for connections.

I don't know if that's really true - if you're renting the server from a cloud provider chances are you can bump down the instance size if you don't need the extra processing capacity... and if it's a server you manually maintain I think lighter usage generally decreases part attrition, though the other factors in that are quite complex.

Re: A tiny Docker image to serve static websites

#108
post #98
post #95

Tbh the moment the author thought about hosting yourself anything to serve static pages -> it was already too much effort. There are free ways to host static pages and extremely inexpensive ways to host static pages that are visited mullions of times per month using simply services built for that.

So, the best free or extremely inexpensive way to host static pages that are visited a lot would be...?

netlify, amplify, cloudflare pages, vercel, et cetera

It's a crowded field now

Re: A tiny Docker image to serve static websites

#109
post #107

there are services specifically for static site hosting. I'd let them do the gritty devops work personally. Netlify, Amplify, Cloudflare Pages, etc.

I use them too. Sometimes I like to have some repos with the static content, which get deployed by a CD tool to those services. It's common for me when debugging or testing locally in my PC or LAN, to include some docker build for those repos which I don't use at production time, but I used it locally. Maybe is not a big problem at all, but I use it that way, specially when in my projects the CND used is not a free one. Makes sense?

Re: A tiny Docker image to serve static websites

#110
post #107

there are services specifically for static site hosting. I'd let them do the gritty devops work personally. Netlify, Amplify, Cloudflare Pages, etc.

I use them too. Sometimes I like to have some repos with the static content, which get deployed by a CD tool to those services. It's common for me when debugging or testing locally in my PC or LAN, to include some docker build for those repos which I don't use at production time, but I used it locally. Maybe is not a big problem at all, but I use it that way, specially when in my projects the CND used is not a free o…

just working off the headline. visiting your link does a great job explaining the use case you have. I'll revisit tonight for a closer look.
Post reply on HN