Add a lightweight schema migration runner, fix missing PHPMailer in prod image
docker-entrypoint-initdb.d only applies db/init.sql, and only on a brand new volume - existing installs never got db/migrations/*.sql applied unless someone ran them by hand. This bit twice this session (qr-oss's own init.sql was missing a migration, and qr-vip's live DB was two migrations behind after a code deploy). scripts/migrate.php now runs automatically on every container start via a new entrypoint wrapper, applying any not-yet-recorded migration - safe to run repeatedly since every migration file already checks information_schema before altering. Also caught in the process: Dockerfile.fpm (the production image) never installed phpmailer/phpmailer, unlike the dev Dockerfile - meaning self-registration's password email has been silently fatal-erroring in production since the nginx+php-fpm switch.
This commit is contained in:
@@ -43,7 +43,8 @@ project by Giandonato Inverso, built on [AdminLTE](https://adminlte.io/).
|
||||
# What is included
|
||||
|
||||
- PHP 8.4 application source
|
||||
- Database schema + migrations
|
||||
- Database schema + migrations (applied automatically on every container start,
|
||||
so `git pull` + restart is enough to bring an existing install up to date)
|
||||
- Docker Compose files (dev and production)
|
||||
- CSS/JS assets
|
||||
|
||||
|
||||
Reference in New Issue
Block a user