- flake input atrocore-docker rev-pinned (e1e9bed) - pkgs/atropim-image: atropim-build/atropim-push scripts + 2-stage podman build (vendor pdf target + entrypoint wrapper) - entrypoint writes ATRO_DB_* to data/config.php at runtime, guarded by isInstalled (idempotent); no DB credentials in layers - devShell documents build/push commands and ENV variables
25 lines
1.1 KiB
Bash
25 lines
1.1 KiB
Bash
#!/bin/sh
|
|
# Secret-free AtroPIM image entrypoint.
|
|
#
|
|
# Before cron/apache start, the ATRO_DB_* environment variables are written
|
|
# into data/config.php of the instance directory (same pattern as the vendor's
|
|
# prepare-pim.php). The PHP side skips the write once the instance is
|
|
# installed (isInstalled), which makes the wrapper idempotent: a config
|
|
# completed by the web installer is never overwritten.
|
|
|
|
set -e
|
|
|
|
INSTANCE_DIR="/var/www/${ATRO_INSTANCE_DIR:-pim.l.az-gruppe.com}"
|
|
|
|
if [ -n "${ATRO_DB_HOST:-}" ] && [ -n "${ATRO_DB_NAME:-}" ] && [ -n "${ATRO_DB_USER:-}" ] && [ -n "${ATRO_DB_PASSWORD:-}" ]; then
|
|
echo "[entrypoint] applying ATRO_DB_* variables to ${INSTANCE_DIR}/data/config.php"
|
|
mkdir -p "${INSTANCE_DIR}/data"
|
|
php /entrypoint-prepare-pim.php "${INSTANCE_DIR}" "${ATRO_DB_HOST}" "${ATRO_DB_NAME}" "${ATRO_DB_USER}" "${ATRO_DB_PASSWORD}"
|
|
# The web installer (running as www-data) must stay able to update the config later.
|
|
chown www-data:www-data "${INSTANCE_DIR}/data/config.php"
|
|
else
|
|
echo "[entrypoint] no ATRO_DB_* variables set - starting web installer"
|
|
fi
|
|
|
|
exec /startup.sh
|