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.

Intro to Docker, React, and Security

71 pointsby lowproover 6 years ago

2 comments

nlover 6 years ago
Ironically it was only yesterday that someone asked &quot;Ask HN: Why do tutorial writers combine 10 technologies when 1 or 2 would do?&quot;[1]<p>I think this is a perfect example of how <i>not</i> to write a tutorial. It doesn&#x27;t actually <i>teach</i> anything - instead it is effectively a set of commands that someone should type in exactly and it will work.. hopefully.<p>I think this point in the introduction sums up this approach:<p><i>I’d like to point out that the broken branch wasn’t working for some (still) unknown reason related to versioning between when we set up the system and when we upgraded some of the components including nodejs.</i><p>and later:<p><i>Note for the app we created we used nodejs v8.10.0 and npm v6.4.0, although installing newer versions shouldn’t be an issue.</i><p>So.. they don&#x27;t know why it broke, but any newer version <i>should be fine</i>.<p>[1] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=18950679" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=18950679</a>
评论 #18966512 未加载
评论 #18959739 未加载
praseodymover 6 years ago
It is a bad idea to use a full-blown Node.js web server to serve some static content. A better solution would be to build the app in one container and then build another Nginx container to serve it. This container can then be hardened (run as non-root, use a read-only filesystem). An added benefit is that Nginx uses fewer system resources (~10 megabytes of RAM will work just fine).<p>We’re running such a setup in production; a sample Dockerfile can be found on <a href="https:&#x2F;&#x2F;github.com&#x2F;WISVCH&#x2F;docker-nginx" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;WISVCH&#x2F;docker-nginx</a>.
评论 #18958672 未加载
评论 #18966534 未加载