Hi, I’m just getting started with Docker, so apologies in advance if this seems silly.
I used to self-host multiple services (RSS reader, invoicing software, personal wiki) directly on a VPS using nginx and mariadb. I messed it up recently and am starting again, but this time I took the docker route.
So I’ve set up the invoicing software (InvoiceNinja), and everything is working as I want.
Now that I want to add the other services (ttrss and dokuwiki), should I set up new containers? It feels wasteful.
Instead, if I add additional configs to the existing servers that the InvoiceNinja docker-compose generated (nginx, and mysql), I’m worried that an update to Invoiceninja would have a chance of messing up the other setups as well.
It shouldn’t, from my understanding of how docker containers work, but I’m not 100% sure. What would be the best way to proceed?
appel@whiskers.bim.boats 10 months ago
Use new containers, that’s what they’re for.
mudeth@lemmy.ca 10 months ago
That would be ideal, per my understanding of the architecture.
So will docker then minimize the system footprint for me? If I run two mysql containers, it won’t necessarily take twice the resources of a single mysql container? I’m seeing that the existing mysql process in
top
is using 15% of my VPS’s RAM, I don’t want to spin up another one if it’s going to scale linearly.moonpiedumplings@programming.dev 10 months ago
It’s complicated, but essentially, no.
Docker images, are built in layers. Each layer is a step in the build process. Layers that are identical, are shared between containers to the point of it taking up the ram of only running the layer once.
Although, it should be noted that docker doesn’t load the whole container into memory, like a normal linux os. Unused stuff will just sit on your disk, just like normal. So rather, binaries or libraries loaded twice via two docker containers will only use up the ram of one instance. This is similar to how shared libraries reduce ram usage.
Docker only has these features, deduplication, if you are using overlayfs or aufs, but I think overlayfs is the default.
moonpiedumplings.github.io/…/setting-up-kasm/#tur…
Please just run two databases on your single mysql container. That is best practice, and probably best for your sanity.
bjorney@lemmy.ca 10 months ago
It will as far as runtime resources
You can (and should) just use the one MySQL container for all your applications. Set up a different database/schema for each container
scorpionix@feddit.de 10 months ago
AFAIK it won’t and should you still get a bottleneck you can limit the maximum resources a service may use.