2026-09-03 17:45:35 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
set -e
|
|
|
|
|
|
2026-09-03 17:51:56 +01:00
|
|
|
# Storage lives outside the app directory when the source is bind-mounted for
|
|
|
|
|
# development (see docker-compose.yml); the plain image falls back to ./storage.
|
|
|
|
|
STORAGE_DIR="${STORAGE_PATH:-storage}"
|
|
|
|
|
mkdir -p "$STORAGE_DIR"
|
2026-09-05 02:15:39 +01:00
|
|
|
chown -R apache:apache "$STORAGE_DIR"
|
2026-09-03 17:45:35 +01:00
|
|
|
|
2026-09-05 02:15:39 +01:00
|
|
|
# Apply pending migrations as apache so the SQLite file it creates stays
|
|
|
|
|
# writable by the web server. su-exec, not su -- BusyBox's su (this is an
|
|
|
|
|
# Alpine image) doesn't take the same -c/user argument order as the GNU one.
|
|
|
|
|
su-exec apache php bin/migrate.php
|
2026-09-03 17:45:35 +01:00
|
|
|
|
2026-09-05 02:15:39 +01:00
|
|
|
exec "$@"
|