I’ve tried different permission combinations including 777 and various user ownership changes but nothing works. The container starts locally without any issues. What could be causing this permission problem in the CI environment?
Sounds like SELinux or AppArmor is blocking something in CI. Try the --privileged flag with docker run, or set privileged: true in your compose file. GitHub Actions uses different Docker daemon settings than your local machine, so volume permissions get weird.
I encountered a similar issue with n8n containers in CI pipelines. GitHub Actions runners have different filesystem semantics compared to your local Docker daemon. Instead of altering host permissions, consider using a named volume for the n8n data directory instead of bind mounts.
Then, add this at the bottom of your compose file:
volumes:
n8n_data:
This approach allows Docker to manage permission mapping autonomously, eliminating potential host filesystem complications. It functions effectively across diverse CI environments like GitHub Actions and GitLab CI, with the container creating and managing the volume with the correct permissions.
This happens because GitHub Actions handles Docker volume mounts and file permissions differently than your local machine. Docker runs with different user mappings in CI environments.
Try adding the user spec directly to your docker-compose file:
Use the specific UID/GID that n8n expects (1001) instead of creating a new node user on the host. GitHub Actions runners have different user contexts - that’s why it works locally but breaks in CI.