
Ask HN: How to deploy a single web page in 2019? - laurentdc
So, I&#x27;ve made a internal web page for a friend&#x27;s company.<p>It&#x27;s a index.html with a Bootstrap hero image and responsive grid, then there&#x27;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.<p>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&#x27;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&#x2F; and js&#x2F; 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&#x2F; folder? Do I Dockerize all this and reverse proxy it behind the existing Nginx instance?<p>Sorry if this sounds like parody but I&#x27;m really confused :&#x2F;
======
rahimnathwani
Host it on Netlify. Netlify can watch for GitHub commits and automatically
deploy new versions. It can also run a build command and deploy the output, if
the stuff you want deployed isn't already in the commit.

Netlify is cheap ($0/month), easy to use, and has its own CDN.

~~~
powerslacker
Came here to say this. As an added bonus you can set up Forestry to connect to
your page if you use a static site generator. Its unbeatable.

~~~
rahimnathwani
I use Netlify CMS. I hadn't heard about Forestry until you mentioned it.

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](https://news.ycombinator.com/item?id=19987008)

------
krapp
Stop worrying about what "everyone else" is doing. FTP and Git push/pull are
perfectly fine for something like this.

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.

~~~
gitzen
This is very good advice. I am beginning to become worried that hobby projects
now consider using heavyweight tools that make sense in companies.

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.

~~~
gshdg
Why host it on anything more complex than S3? You don’t need a “real” server
for this. The most you need is a cheapo $2/mo shared hosting account.

------
bradwood
Build a ci/cd pipeline in gitlab-ci or travis to push it to s3. Mix in a bit
of terraform to set up ssl, s3, route53, etc

------
gitzen
SCPing or Git push/pull is exactly how I would do this.

> 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. :-)

------
rwieruch
Digital Ocean with Server Blocks. That's how I host multiple static websites
in one 5$ Droplet. Otherwise, Digital Ocean with Dokku for web applications to
host multiple apps in one Droplet as well. [0]

[0] [https://www.robinwieruch.de/deploy-applications-digital-
ocea...](https://www.robinwieruch.de/deploy-applications-digital-ocean/)

------
codegeek
"I could just FTP this to the server nginx folder"

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.

~~~
iKevinShah
Occam's razor!

~~~
sarahhudson
Setting up SSL yourself, even with the wonderful scripts from Let's Encrypt,
isn't the simplest solution IMO.

------
wolco
Two concepts:

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.

------
niklasmtj
Since you mentioned that this would be an internal web page for your friend's
company Netlify does not seem to be the best answer for that. When there is
already a working nginx just push it via FTP. If you know how this is done, do
it like that.

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.

------
codegladiator
Yes, use vue cli to generate the skeleton app, it will add all the things you
mentioned like webpack. Then use Travis or circle ci to build the app, finally
setup a kubernetes cluster so you can deploy your docker image easily plus get
ssl certificate and other benefits quickly. Now you can call this an app
instead of web page.

Who even does just a html?

~~~
bradwood
K8s for a single “web page”? Really?

~~~
codegladiator
No questions for vue cli for a single "web page"? Really? Or even ci/cd?

------
ryanmccullagh
My side project does exactly this. You push to GitHub and your changes are
deployed automatically. You built your assets locally, and then push your
production code to GitHub.

I’ll give you the link to my project.
[https://www.amezmo.com](https://www.amezmo.com)

------
recov
Personally I set up a dokku instance on a cheap vps. Very similar to heroku
but allows multiple projects to be run. On commit gitlab pushes to my dokku
instance and it's deployed.

What ever method you choose, I definitely recommend a CD pipeline on commit.

------
slap_shot
Build it however you're comfortable with and push it to Heroku however you're
comfortable with.

------
throw03172019
I use s3_website. Configures and deploys to S3 with option to serve via
CloudFront.

------
sergiotapia
i use netlify, connect it to the github repo, build static assets, you're
done.

------
barli
try Pingy, it's at pin.gy

