#!/bin/sh set -e # Ensure the data directory exists and is owned by the node user. # This fixes permission issues with bind-mounted volumes (e.g. ./data:/app/data) # where the host directory is owned by root but the container runs as node. mkdir -p /app/data chown -R node:node /app/data 2>/dev/null || true # Drop privileges and run the actual application as node exec su-exec node "$@"