TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Intro to Docker, React, and Security

71 点作者 lowpro超过 6 年前

2 条评论

nl超过 6 年前
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 未加载
praseodym超过 6 年前
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 未加载