The Docker container now handles data directory permissions automatically without requiring manual user setup. Changes: - Added entrypoint.sh script that runs as root, fixes /data permissions, then drops to non-root user (towerops) using su-exec - Updated Dockerfile to install su-exec and use the entrypoint script - Container starts as root but immediately drops privileges after fixing permissions The agent will now start successfully with just 'docker-compose up -d' without users needing to run chown commands manually.
11 lines
250 B
Bash
11 lines
250 B
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
# Ensure /data directory exists and has proper permissions
|
|
if [ -d /data ]; then
|
|
# Fix ownership if needed
|
|
chown -R towerops:towerops /data
|
|
fi
|
|
|
|
# Drop to towerops user and run the agent
|
|
exec su-exec towerops towerops-agent "$@"
|