Skip to content

Set up the databases with scripts on stock MariaDB/MongoDB images instead of custom images #1046

Open

Description

@ismisepaul

Replaces #1025. Instead of publishing custom MariaDB and MongoDB images, provide scripts that set up the databases on stock images and on any MariaDB/MySQL or MongoDB server. The Docker Compose quick start and self-hosting then share one setup path, and only owasp/security-shepherd is published.

Why

The custom images in docker/mariadb and docker/mongo are the stock images plus:

  • the schema files coreSchema.sql, moduleSchemas.sql and moduleSchemas.js, copied into /docker-entrypoint-initdb.d;
  • three text edits, done with sed at build time:
  • a small config file.

Publishing them would mean rebuilding and republishing for every upstream MariaDB/Mongo patch, or serving stale databases under the OWASP name. The quick start clones the repo anyway, so the scripts are already there.

Proposal

  • Scripts such as scripts/db/setup-mariadb.sh and scripts/db/setup-mongo.sh that:
    • read the schema files from src/main/resources, and make the three edits when they run rather than at build time;
    • take the challenge users' grant host as a setting, defaulting to '%', so remote databases work;
    • work in a stock image's /docker-entrypoint-initdb.d, using that image's admin credentials;
    • also run against your own server, with host, port and admin credentials as arguments.
  • docker-compose.yml uses the stock mariadb and mongo images and mounts the scripts and schema files.
  • Remove docker/mariadb/Dockerfile, docker/mongo/Dockerfile, convert-sql-scripts.sh and the Maven steps that copy and convert the database files. mvn -Pdocker then only builds the WAR.
  • Docs: the README's Docker section, plus a short "bring your own database" section covering supported versions and how to run the scripts.

Related

Activity

  1. added this to the 4.0.0 milestone on Oct 25, 2026
  2. 2300031984 commented on Oct 29, 2026

    @2300031984
    Contributor

    Hi @ismisepaul, I’d like to contribute to this issue. I understand the goal is to replace the custom MariaDB and MongoDB images with stock images and reusable database setup scripts that support both Docker Compose and externally hosted databases.

    Would you be open to a contribution for this? Given the scope, would you prefer the work to be split into smaller PRs, and is there a particular part you’d recommend starting with?

  3. modified the milestones: 4.0.0, 4.1.0 on Nov 1, 2026
  4. ismisepaul commented on Nov 1, 2026

    @ismisepaul
    MemberAuthor

    we not focusing on this right now, our aim is to get a release out (4.0.0 milestone), planning this to be within 4.1.0 instead

  5. 2300031984 commented on Nov 2, 2026

    @2300031984
    Contributor

    Thanks for letting me know. I understand the focus is currently on the 4.0.0 release, and this issue is planned for 4.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions