WADDLE_DB_USER and WADDLE_DB_PASSWORD

What WADDLE_DB_USER and WADDLE_DB_PASSWORD are, why they stay out of git, and how your project's scripts reference them.

WADDLE_DB_USER and WADDLE_DB_PASSWORD are the project’s database credentials, exposed to containers as environment variables so platform scripts, and committed config files, can reference them by name instead of embedding the literal values.

Why an environment variable, not a committed value

Files that are part of a git repository should never contain sensitive information. Waddle keeps the credentials in the project’s private, never-committed configuration file instead, and injects them at build/deploy time into the target environment. This way, only the reference to these variables is exposed in the files that are part of the repository itself.

Where the values come from

Sourced from the project’s private configuration, then written into the project’s .env file:

  • Locally, when the project is built.
  • On a remote, at deploy time.

Docker Compose automatically reads that .env file and interpolates ${WADDLE_DB_USER} and ${WADDLE_DB_PASSWORD} into the environment: block of each container that needs them (at the time of writing that’s php and db), so the literal password never appears in the committed docker-compose.yml.

We actively avoid adding these variables to containers that don’t need them, such as web, redis, opensearch, and node, to ensure that services with no reason to touch the database also have no access to its credentials.

Using them in a script

Reference them the same way the shipped platforms do, for example phpBB’s after_db_updated.sh:

docker compose exec -i db mysql \
    -u "${WADDLE_DB_USER}" \
    -p"${WADDLE_DB_PASSWORD}" \
    "{{public.website.db_name}}"

A script that runs outside the main build flow, over SSH, or after a manual database sync, should source the project’s .env itself first, since nothing else loads it in that context:

if [ -f .env ]; then
    set -a
    . ./.env
    set +a
fi