9 ms·
I I’m not going to tell people not to do this, but in my opinion this is massive overkill for a simple blog. Why use docker when you can just run nginx on the h
by AndrewStephens 8y ago
I I’m not going to tell people not to do this, but in my opinion this is massive overkill for a simple blog. Why use docker when you can just run nginx on the host with certbot for LetsEncrypt.
I guess docker gives you some flexibility for rollover and load balancing, but a single droplet will handle huge amounts of traffic for static sites.
- deleted 8y ago[deleted]
- finaliteration 8y agoIt might be a good simple project for those not familiar with Docker and web server/nginx configuration. But other than that, I agree with you. Seems like a lot of overhead.
- mamon 8y agoWhy I use Docker for everything? saves me from dependency hell, chasing down the required libraries. Plus, some more complex stacks, which normally would take like half day to install now take just one "docker run" command (or "docker-compose up"). That's how I installed Nextcloud, Gitlab, etc. I think that Docker is a great time saver for those who want just to play with a new piece of software, and don't have the time to learn all the details of some arcane install procedure.
- twblalock 8y ago> I think that Docker is a great time saver for those who want just to play with a new piece of software, and don't have the time to learn all the details of some arcane install procedure. That's true, but if you do that in production you're running untrusted code that could do pretty much anything. If you don't have your own Docker registry full of containers you either made yourself or have audited yourself, you might as well let anyone in the world run their code on your servers. And if you do have your own registry, it's a lot of work and it involves chasing down libraries and working with arcane install procedures. You can't really trust the public base images unless you fork them and audit them yourself, or just create your own. At some point you need to take responsibility for your own stack. Docker fine for messing around on your laptop but the real work starts when you need to get past that.
- dewey 8y agoBut if you are not reviewing every other piece of code that you run without Docker it’s not much different from running it in Docker without reviewing the base image / images pulled in as dependencies.
- akvadrako 8y agoIndeed, for more and more people Docker is just the standard packaging solution. It's like saying "why use packages? You can just download the source and dependencies, then compile it manually".
- afarrell 8y ago> Why use... This is usually the most important question to ask about a tool for a project. However, it is reasonable for the answer to be "because I"ve heard that this tool is useful, and I want to better understand how it is shaped and what things are hard/easy to do with it"
- nineteen999 8y agoWhich is cool when it's your own personal blog and all, but when it happens in a production environment and it's an unnecessary component, and you're the only person working on it, and you omit to document how you're using it before leaving for another job ... I believe this is referred to as "resume driven development".
- amanzi 8y agoThere are many reasons why you would want to use Docker but for me the biggest one is that the entire configuration, installation, and deployment is all self-contained in that docker-compose file. The rollover and load balancing features are also nice if you need to scale out but even on a single server there is a solid case to be made to use Docker. The alternative you've presented is that you'd need to install and configure Nginx, then install and configure LetsEncrypt, then install and configure Ghost. And then you'd need to make sure you documented all the steps you've performed so that you can do it again if needed in the future. The docker-compose file aligns to the "infrastructure as code" methodology and while there are many other tools that could achieve the same thing (Terraform, Ansible, Salt, etc) using docker-compose in this scenario seems to make sense.
- buildme 8y agoNothing about using Docker for this makes sense. I’m sick of administrating clever Docker projects because apparently installing nginx on its on (which can easily be done with Ansible or Salt or even a shell script at this point) is too much to ask to host a static website. Those of us who live in Opsland hate maintaining all of these half-baked wheel reinventions.
- sneak 8y ago> There are many reasons why you would want to use Docker but for me the biggest one is that the entire configuration, installation, and deployment is all self-contained in that docker-compose file. Until you write your first blog post or get a single comment. Then you need backups like everyone else who runs their own shit.
- codetrotter 8y agoInstalling and configuring Caddy to serve a static site over HTTPS is dead easy, and probably less work than setting up Docker. Caddy has built-in support for Let’s Encrypt. I use the dns module which required a little bit of extra work to enable because it’s not included by default but other than that it’s very simple like I said. Here is the config file for one of my sites: www.crusaders.pw { root /var/www/pw.crusaders.www/ expires { match .htm$ 4h match /assets/.* 1y } tls { dns cloudflare } } crusaders.pw { redir https://www.crusaders.pw{uri} tls { dns cloudflare } } Then just stick the config file in a git repo.
- zawerf 8y agoIn some sense everything is massive overkill for a "simple blog". You should just pay for medium/wordpress/ghost or use a static site hosted on github pages. I personally fell for these posts a while back and regretted spending time on it. They don't tell you about the crazy amount of sysadmin skills that you need to get it up and running: Do you need to worry about updates/security patches? How do you configure firewalls? How do you configure ssh settings? How would you even audit unauthorized logins? Where are logs stored? Are they rotated? Are they backed up? Are there backups? How do you restore from backups? How do you configure nginx? How do you configure certbot? How do you check if cron is running correctly? Do you ever look at access/error logs? How do you keep services running upon restart? How do you get notified of problems? How do you monitor uptime? Each individual question will take minutes to hours to research and will open up new rabbit holes.
- Jedi72 8y agoThat's why I think these blogs/projects are useful. Or should people learn all this stuff first time they run a real app in production?
- delinka 8y agoMost bloggers aren't ever going to "run a real app in production." Most {net,dev,sec}ops engineers aren't writing blogs.
- peatfreak 8y ago> Most {net,dev,sec}ops engineers aren't writing blogs. Unfortunately, in my experience this is true. It's not for lack of motivation or desire, it's because my day job is stressful and tiring. The last thing I want to do when I come home in the evening is to spend my valuable personal time writing a blog about what I did at work. I would rather spend time with my family, or do something like that. Of course, I could try to schedule time during work hours to write a blog on the company website by talking with my manager about it. Unless this advances any strategic or political agenda, it's unlikely to happen.
- nickthemagicman 8y agoIt's a good learnin' experience. but ideally for this a simple netlify/static site generator would be the bizzy.
- spullara 8y agoS3 with a static blog generator seems sufficient at this point and will likely cost pennies per month.
- bschwindHN 8y agoAgreed. I do this and I pay around 5 cents a month. Can't imagine wanting to run Docker for a simple static blog.
- outworlder 8y agoWell, if you are complaining about "overkill", why even run a server? It's a blog, it can be static. Serve from S3, Github pages or what have you.
- tootahe45 8y agoWhy use any of that when every cloud provider incl Digital Ocean has a click-to-deploy WordPress app and you can just use Cloudflare DNS records for DDoS protection/speed/SSL all in one with no configuration required?
- nickjj 8y agoI'm a huge advocate of using Docker but a static blog is one of the use cases where I don't bother using Docker. It's mainly because development and production are very different in that case.
- __mp 8y agoI use it on my own server, a dedicated quad-core machine with 64 GB RAM (hetzner.de). Mainly because I host a multitude of different websites that require different technologies: PHP, Rails, Node, Go and Python. Setting everything up with Docker makes management a breeze and I can easily relocate and backup the entire setup to a different server. I backup everything daily to my Synology at home.
- giancarlostoro 8y agoNow this makes sense to me, but depending on how much you're paying in the case of DigitalOcean you could just spin up different droplets.
- giancarlostoro 8y agoNot sure about that, I find it odd to run docker on DigitalOcean. I gave up trying to write my own blog engine for now and decided to use wordpress on a shared host that costs me $5 a year. Way easier and less overhead. No docker, no monthly payments, just a blog.
- cirgue 8y agoFor anyone interested, here is a stab at a flask, nginx, gunicorn, and Let's Encrypt setup on a digital ocean server. Disclaimer: I am a rank novice when it comes to web development and would appreciate any feedback. https://github.com/cirgue/flask_template https://github.com/cirgue/flask_template