3 ms·
I'm a bit surprised to see this on the Hacker News frontpage. It's not terrible, but it's kind of just some how-to content on what I think many would consider a
by jchw 3y ago
I'm a bit surprised to see this on the Hacker News frontpage. It's not terrible, but it's kind of just some how-to content on what I think many would consider a fairly mundane task. On one hand, it IS a reasonable step up from SEO crap you'd read typing hot keywords like "React" and "Docker" into Google: it's relatively succinct and doesn't seem like it's doing anything wrong. On the other hand, it doesn't really build a case for why you'd do this, what the pros and cons of an approach like this is, etc. which is what I expect more people would find interesting.
Like, for example, why would you do this? It's a good question for someone who's looking to do this to ask themselves before doing it, and therefore a good question to try to answer. Like for example, if I'm trying to deploy to a service like Fly.io or into a Kubernetes cluster, then this may very well be the right thing to do.
However, if I'm a n00b and I just know people deploy things with Docker, I might miss that it'd actually be much easier to just push this stuff to Cloudflare Pages, Vercel, Netlify or another static pages hosting tool/CDN.
Some people read articles like this without having much of a basis for why you would want to add all of this complexity, and it leads them to think it's the right choice when it isn't necessarily. Generally the answer for why to do this, in my mind, is something along the lines of uniformity; having everything be an OCI image is convenient, and in the case of a PaaS or existing container cluster setup, it might be necessary if you want your frontend deployment to go alongside your other containers. It also has the benefit of being easier to test exactly how it will run locally, whereas with something like Cloudflare Pages you might need to play around to figure out how things like redirect rules will wind up working when you actually deploy it.
- nkozyra 3y ago> It's not terrible, but it's kind of just some how-to content on what I think many would consider a fairly mundane task I'm also a bit surprised. This is the kind of deployment you can hack together in 30 minutes if you know almost nothing about React builds, nginx, or Docker. It's one of the more trivial Docker tasks out there.
- meiraleal 3y agoIt seems that React over-engineering is triggering many here (me included). When I saw the post my first reaction was: "why?". But having a container to deploy makes more sense than telling people to just use Vercel or cloudflare. Default to cloud isn't a good mindset.
- jchw 3y agoI understand the sentiment, but the point isn't "Cloud", the point is CDN/file server. The truth is though, that yes, I would generally recommend someone who has never deployed a front end application before to "default to 'cloud'" in that they should absolutely, 100% use a CDN service that handles everything for them, including deployments and rollbacks, availability, etc. Doesn't have to be any specific service: they're all just about the same. No lock-in required. Cloud can be bad, but in this case it's barely any different from what people used to do with cPanel hosting back in the day. The point is to just drop some files somewhere and have someone else's HTTP server host them.
- meiraleal 3y ago> Cloud can be bad, but in this case it's barely any different from what people used to do with cPanel hosting back in the day. Yes but I don't think we should be outraged over posts that discuss deploying with an HTTP server. If anything, the concern should be over the focus on specific platforms like Vercel/Next.js, or Cloudflare Workers limiting broader understanding and options.