TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How do you serve static files in a Docker container?

3 pointsby DontBreakAlexabout 1 year ago
I usually use thttpd in an alpine container. I think I remember seeing a similar server that read files at startup to load them in memory and pre-compress them while running in a from-scratch container, but I can't seem to find it on the internet. What do you guys use ?

5 comments

stop50about 1 year ago
I don't. I serve static files directly from the nginx.
nijaveabout 1 year ago
I'd think given enough memory, your files will cache in memory pretty quickly with any server. I usually just use nginx for these use cases or look to a CDN solution.
brettv2about 1 year ago
why wouldn't you just serve them via a CDN?
评论 #39873753 未加载
corytheboydabout 1 year ago
+1 for copy files to container, serve with nginx
joshxyzabout 1 year ago
caddy can serve it, with free tls<p>if js project i sometimes use npx serve too