#!/bin/sh set -e # ── Memory limit override ────────────────────────────────────────────── # If OMNIROUTE_MEMORY_MB is set, build NODE_OPTIONS dynamically so the # user can tune heap size via environment without editing the Dockerfile. if [ -n "$OMNIROUTE_MEMORY_MB" ]; then export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=${OMNIROUTE_MEMORY_MB}" fi DATA_PATH="${DATA_DIR:-/app/data}" if [ -d "$DATA_PATH" ] && [ ! -w "$DATA_PATH" ]; then echo "WARNING: $DATA_PATH is not writable by the current user (UID $(id -u))." if [ "${CONTAINER_HOST:-}" = "podman" ]; then echo "Rootless Podman maps container UIDs into a subordinate range." echo "Run this on the host to fix (using the host-side bind-mount path):" echo " podman unshare chown -R $(id -u):$(id -g) " else echo "Run this on the Docker host to fix (using the host-side bind-mount path):" echo " sudo chown -R $(id -u):$(id -g) " echo " chmod -R u+rwX " fi fi exec "$@"