So I’m in the process of (re-) setting up my homelab and unsure about how to handle databases. Many images require a database, which the docker-compose usually provides inside the stack.

Now my question, shall I have 1 database container which is accessed by all containers? Or shall I have a separate container for each service?

For critical services, which shall have as few dependencies as possible I’m already using sqlite or a similar solution.

Also on a sidenote: I have two docker hosts, can I let the containers of 1 hypervisors use the same internal docker network?

TIA!

  • anteaters@feddit.de
    link
    fedilink
    English
    arrow-up
    14
    ·
    1 year ago

    I wondered about that myself these days and decided to give each stack its own db. Makes it easier to throw a stack into the bin without having to manually prune the associated databases. I might end up running a database container anyways for tests and side projects and things like that but service stacks get their own db of their choice.