4 ms·
> How do you update nginx, or git, or python/php/ruby (if you're using one of those for your little app)? I suppose you mean automatically update? If so, this
by chmod775 6y ago
> How do you update nginx, or git, or python/php/ruby (if you're using one of those for your little app)?
I suppose you mean automatically update? If so, this has been solved decades ago. Unattended upgrades is just another debian package you can install.
If you meant just update in general, that's a pretty silly question.
> An automatic install script with a deb is _way_ more work
You misunderstand. You can use the automatic install script to create the .deb - or a script based on it. Basically instead of on a live system, you place the same files in a tree you create the deb package from.
Even if you use docker, I still recommend learning about how debian packages work. Installing your app in a docker container using a .deb is strictly nicer than having all those steps in a Dockerfile. Plus this way you can specifiy your secondary dependencies declaratively.
> more work and way less portable than writing: FROM nginx COPY . .
Now that is just flat-out wrong. The steps you'd execute after "FROM nginx" are the same steps you'd execute after apt-get install nginx. It's not more work, it's the same or less - because you don't need to deal with docker on top of everything.
You have the added benefit that afterwards you can install the .deb in a debian-based docker container, but you don't have to. You're not reliant on docker.
Oh great example btw. Because the debian-based nginx docker container is essentially created with "apt-get install nginx" in its Dockerfile. Funny how you're trying to argue against the setup I proposed by citing a docker package that does things precisely that way.
> What happens if you get a spike in usage and it kills your little server?
Yeah that's not gonna happen to a static blog behind CF. Also at least that way you're always only paying $5, regardless of what happens.
The sort of traffic that kills a $5 VPS serving only a basic static blog can bankrupt you on an automatically scaling infra.
- maccard 6y ago> If you meant just update in general, that's a pretty silly question. I disagree. How do you update manually? If your answer is ssh in and manually update, that's how you end up with a pile of different versions, and no reference what they are? You've now got random packages at random versions. If you automatically update, they're not infalliable, e.g. here's [0] a post from 12 months ago about someone having an issue with nginx not restarting. > You misunderstand. You can use the automatic install script to create the .deb So now you have a deb package, and an install script; that's more complex and more work than a dockerfile (which is standard at this point. How do you update your deb package? With docker, you use the same commands above. > You have the added benefit that afterwards you can install the .deb in a debian-based docker container, but you don't have to. You're not reliant on docker You're reliant on debian, and the configuration of the OS underneath it, including the version of nginx, python, ruby, etc. With a docker image, that stuff is all pinned unless you engage with updating it. > Yeah that's not gonna happen to a static blog behind CF. Also at least that way you're always only paying $5, regardless of what happens. > The sort of traffic that kills a $5 VPS serving only a basic static blog can bankrupt you on an automatically scaling infra. Nobody is talking about auto scaling infra here, except you. You can run docker on a $5 VPS, or on a $5 DO app platform. If your blog dies, e.g. due to aws performing maintenance[1], you need to bring it back online. If you migrate to a smaller host or larger host, you need to rebuild it. [0] https://www.digitalocean.com/community/questions/problems-installing-nginx-on-ubuntu-18-04 https://www.digitalocean.com/community/questions/problems-in... [1] https://www.quora.com/How-often-do-EC2-instances-fail-Why https://www.quora.com/How-often-do-EC2-instances-fail-Why
- chmod775 6y ago> I disagree. How do you update manually? If your answer is ssh in and manually update, that's how you end up with a pile of different versions, and no reference what they are? On one server? What? > With a docker image, that stuff is all pinned unless you engage with updating it. Yeah now we're entering super silly territory. You can pin versions[1] in your debian package control file and/or on debian directly. But in general automatic updates are preferable. Unattended upgrades is often configured to only install security updates. Better to have stuff potentially going offline due to an update than running insecure versions of software. What, do you subscribe to every single mailing list of every bit of software you're running in your docker containers, so you can manually update them when there's security issues with one? You better have some automatism here or your setup is strictly worse than what Linux distributions could do decades ago. Like not just worse, it's broken. > e.g. here's [0] a post from 12 months ago about someone having an issue with nginx not restarting. That's ubuntu, not debian. Very different approach to non-security updates. [1]: Here's how the depends line looks in one of my debian packages' control file: Depends: python (<< 3.0.0), ffmpeg (>= 10), imagemagick (>=8), webp, clamav-daemon(>=0.98.0), cron, haproxy (>= 1.7.0), psmisc, ntp, file, certbot, firejail, exiftool
- maccard 6y agoYou still haven't answered my question; how do you update? Yes on one server. If you ssh into that server or poke around on it, how do you rebuild it if aws kills your instance, or if your data center catches fire? Re; version pinning that's cool - both methods work. For updates, of course it's automated that's the whole point. > That's ubuntu, not debian. Very different approach to non-security updates. Actually this is a really interesting point; I don't want to be a sysadmin, I want to run my applications. I don't want to be aware of the platform differences. I actually didn't know that ubuntu and debian handled updates differently. They both expose the same interface to package management. Features like that are exactly why developers like me should be deploying docker containers to DO's app platforms for $5 a month, and not running VPS's
- chmod775 6y ago