Make Docker bind mounts actually work; refresh homepage feature grid
App/, cache/, uploads/, and data/ are now bind-mounted by default, so docker-entrypoint.sh seeds an empty App/ from a build-time backup and re-chowns the mounted paths to http:http on every start (a bind mount doesn't inherit a named volume's ownership or get seeded from the image the way COPY does). Also fixes AllowOverride never actually being enabled (the sed pattern didn't account for httpd.conf's indentation, so only DirectoryIndex-served routes worked) and pins Apache/PHP/SQLite to a dated Arch Linux Archive snapshot for reproducible builds. Homepage's feature grid was six cards behind what's actually shipped; brought it in line with the features blog post. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
# Runs once per container start, before Apache — see /admin/docs/docker.
|
||||
#
|
||||
# docker-compose.yml bind-mounts App/, public/cache/, public/uploads/, and
|
||||
# data/ from the host so a project's content/db survive a rebuild and can be
|
||||
# edited without one. Two problems a plain COPY-at-build-time image can't
|
||||
# solve on its own:
|
||||
#
|
||||
# 1. A bind mount to an empty (or not-yet-created) host directory shadows
|
||||
# whatever COPY baked into that path in the image, replacing it with
|
||||
# nothing — Docker does not seed bind mounts from image content the way
|
||||
# it seeds a fresh named volume. App/ is only ever the docs/starter
|
||||
# content wanted on host: seed it from the pristine copy stashed
|
||||
# at build time (/opt/novaconium-app-default) if the mounted dir is
|
||||
# empty, so `docker compose up` produces a working site on a first run
|
||||
# with no manual copy step.
|
||||
# 2. A bind-mounted host directory keeps the host's ownership, not the
|
||||
# image's — the build-time `chown` in the Dockerfile never applies to
|
||||
# it. Re-chown the mounted paths to the Apache worker user on every
|
||||
# start so they're writable regardless of the host-side UID/GID.
|
||||
set -e
|
||||
|
||||
if [ -z "$(ls -A /var/www/html/App 2>/dev/null)" ]; then
|
||||
cp -a /opt/novaconium-app-default/. /var/www/html/App/
|
||||
fi
|
||||
|
||||
chown -R http:http /var/www/html/public/cache /var/www/html/public/uploads /var/www/html/App /var/www/html/data
|
||||
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user