Sign inSign up

moneiai/migrations

By moneiai

•Updated about 11 hours ago

One-shot Monei.AI database migration runner

Image
1

7.6K

moneiai/migrations repository overview

⁠Monei.AI Database Migrations

The moneiai/migrations:latest image is the one-shot migration runner for the self-hosted distribution. It is a shell-less scratch image containing a static Go binary and the repository SQL migrations embedded at build time.

⁠Compose usage

The generated Compose stack runs the image before the application starts and passes its internal owner connection through DATABASE_URL. The application waits for a successful migration job. Operators normally update it through the stack rather than invoking it directly:

docker pull moneiai/migrations:latest
docker compose --env-file .env up -d --wait

Keep the migration, application, MCP, and optional Agent images on a compatible release. The migration image does not need a host-mounted migration directory.

⁠Direct usage

For an explicitly reviewed standalone run, place DATABASE_URL=... in a file outside the repository, restrict that file to the operator, and pass its path:

chmod 600 /private/path/monei-migrations.env
docker run --rm \
  --env-file /private/path/monei-migrations.env \
  moneiai/migrations:latest

Remove the file when it is no longer needed. Do not put the connection URL in a command, log, issue, or source-controlled file.

⁠Behavior

  • Requires DATABASE_URL and waits for PostgreSQL to accept connections.
  • Creates the migration ledger when it does not exist.
  • Uses a PostgreSQL advisory lock so only one runner applies migrations.
  • Applies pending embedded migrations in version order and records each version.
  • Exits successfully when the schema is already current.
  • Exits with an error without starting dependent services when a migration cannot be applied.

The executable contract lives in the migration runner source, Dockerfile, and docker/compose.yaml⁠; do not duplicate its migration inventory in this README.

Tag summary

Content type

Image

Digest

sha256:d3ef81a23…

Size

2.8 MB

Last updated

about 11 hours ago

docker pull moneiai/migrations