Ask HN: How to deploy a single web page in 2019?
It's a index.html with a Bootstrap hero image and responsive grid, then there's a index.js with some Vue.js glue logic (get a .json file and populate the Bootstrap grid) and of course some custom css in a custom.css file. Maybe 150-200 lines of code tops.
I could just FTP this to the server nginx folder, or git push to my repo and pull it on the server, and that would work fine. But I've noticed everyone else is doing it differently: should I use npm to install Bootstrap and Vue instead of having them downloaded manually in a css/ and js/ folder? Do people still use bower? Should I use webpack and how do I make webpack come together, like, place scripts and custom css in the right order? Should I just build it all around Vue.js and install bootstrap-vue and use those components instead, and then npm build and deploy the dist/ folder? Do I Dockerize all this and reverse proxy it behind the existing Nginx instance?
Sorry if this sounds like parody but I'm really confused :/
27 comments
[ 2.6 ms ] story [ 66.6 ms ] threadWho even does just a html?
All of those other tools and techniques apply to companies wanting to efficiently organize and deploy projects at scale. If your friend's company is fine with what is essentially just a static brochure page, then that added complexity is unnecessary.
If you're only going to build a simple app for friends and family as a hobby which would receive less than 10000 hits in a day, Kubernetes cluster seems like an overkill. CI (automated builds and tests) could still offer some advantages to maintain good long term health of the hobby project.
But other than that just copying over the files or pulling it from Git sounds just fine. Perhaps even go for a cheaper option like Linode or Digital Ocean for hosting instead of AWS/GCP/Azure.
> Sorry if this sounds like parody but I'm really confused :/
Thanks for this clarification. It did seem like parody until I read this clarification. :-)
Netlify is cheap ($0/month), easy to use, and has its own CDN.
Found an older comment thread without a conclusion about whether one has a definite advantage over the other: https://news.ycombinator.com/item?id=19987008
Yep pretty much this. Yes there are some services like netlify that makes it a bit more easier but then you have less control and no fun. I would setup nginx to serve the static files, use letsencrypt to install SSL cert. and done.
I’ll give you the link to my project. https://www.amezmo.com
What ever method you choose, I definitely recommend a CD pipeline on commit.
Sure there are those "cool" new ways but when you know how this could be done in a way you are familiar with go for it.
But if you have the time and the page does not have to be running asap go that way with building it around Vue.js and webpack etc.
Deployment and frontends.
For deployment In the setup you have now you should git or ftp over the files. Any larger complex setup will require hiring someone. Any easy deployable sass solution will work against you interally.
Frontend tooling Frontend tooling has changed and become more complex. What people do is use npm to get the vue cli tool and use that to create the single page application. Unless you want to use sass include bootstrap from html and include fontawesome lib and create a style.css that overrides whatever style changes you neex.
[0] https://www.robinwieruch.de/deploy-applications-digital-ocea...