dbmcp 0.15.0

A single-binary MCP server for MySQL, MariaDB, PostgreSQL, and SQLite
services:
    mariadb_12:
        image: mariadb:12
        volumes:
            - "./seed/mysql.sql:/docker-entrypoint-initdb.d/setup.sql:z"
        ports:
            - "13306:3306"
        environment:
            MARIADB_ROOT_HOST: '%'
            MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: "yes"

    mysql_9:
        image: mysql:9
        volumes:
            - "./seed/mysql.sql:/docker-entrypoint-initdb.d/setup.sql:z"
        ports:
            - "13307:3306"
        environment:
            MYSQL_ROOT_HOST: '%'
            MYSQL_ALLOW_EMPTY_PASSWORD: "yes"

    postgres_18:
        image: postgres:18-alpine
        volumes:
            - "./seed/postgres.sql:/docker-entrypoint-initdb.d/setup.sql:z"
        ports:
            - "15432:5432"
        environment:
            POSTGRES_USER: postgres
            POSTGRES_HOST_AUTH_METHOD: trust

    # SSH bastion for functional_ssh. Tests reach databases by service name,
    # which only resolves inside the compose network, i.e. through sshd.
    sshd:
        image: lscr.io/linuxserver/openssh-server:10.3_p1-r1-ls239
        ports:
            - "12222:2222"
        environment:
            PASSWORD_ACCESS: "true"
            USER_NAME: dbmcp
            USER_PASSWORD: dbmcp
            PUBLIC_KEY_FILE: /keys/authorized_keys
            DOCKER_MODS: linuxserver/mods:openssh-server-ssh-tunnel
        volumes:
            - "./ssh/authorized_keys:/keys/authorized_keys:ro,z"
        # sshd starts only after the ssh-tunnel mod is installed on first boot.
        healthcheck:
            test: ["CMD", "nc", "-z", "127.0.0.1", "2222"]
            interval: 1s
            timeout: 2s
            retries: 120

    sqlite:
        image: alpine/sqlite
        user: "${DOCKER_UID:-1000}:${DOCKER_GID:-1000}"
        entrypoint: sh
        command: -c "rm -f /data/database.db && sqlite3 /data/database.db < /seed/setup.sql"
        volumes:
            - "./seed/sqlite.sql:/seed/setup.sql:ro,z"
            - ".:/data:z"