Bind-mount the project into the container for live edits
docker-compose.yml now mounts the working directory at /var/www/html so PHP changes take effect without an image rebuild. To avoid a mount nested inside that bind mount, the storage directory moves out to /var/www/storage (still a named volume). Config gains a STORAGE_PATH env var driving both the SQLite database and the JWT signing-key location; the entrypoint chowns that directory. The Dockerfile is unchanged and still builds a self-contained image (STORAGE_PATH defaults back to ./storage when unset). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# The storage directory may be a freshly created named volume; make sure it
|
||||
# exists and is writable by the web-server user.
|
||||
mkdir -p storage
|
||||
chown -R www-data:www-data storage
|
||||
# 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"
|
||||
chown -R www-data:www-data "$STORAGE_DIR"
|
||||
|
||||
# Apply pending migrations as www-data so the SQLite file it creates stays
|
||||
# writable by Apache.
|
||||
|
||||
Reference in New Issue
Block a user