[BUG] Container crash: chown: /app/data: Operation not permitted when dropping root privileges
Deployment details:
App version [e.g. v1.7.4]: latest
Platform [e.g. amd64, arm64, arm/v7]: amd64 (Synology NAS / Generic Linux Engine)
Docker image tag [e.g. latest, multiarch]: latest
Bug description:
The Dockerfile hardcodes an administrative system command (chown) into the default container startup sequence (CMD ["sh", "-c", "chown -R node /app/data && node server.js"]).
This architecture makes it impossible to run the container in a hardened, security-conscious environment using native Docker security directives like user: "1030:65536" or --user. When root privileges are dropped by the Docker Engine prior to container instantiation, the container immediately crashes with a chown: /app/data: Operation not permitted error because an unprivileged process does not have permission to change file ownership on the mounted volume.
Hardcoding chown in the runtime CMD violates the principle of least privilege, forces deployments to initially run as root, and breaks compatibility with standard container security hardening practices.
Steps to reproduce:
Create a standard Docker Compose file forcing the container to run as a specific, unprivileged host user ID (e.g., user: "1030:65536").
Map a host directory to the container volume (e.g., - /volume1/docker/flame:/app/data).
Run docker compose up.
Inspect the logs to see the container instantly crash during the initialization phase due to the failed chown sequence.
Source: pawelmalak/flame