fix: CI/CD permission fix

This commit is contained in:
Eric Gullickson
2025-12-27 16:38:28 -06:00
parent dc2c731119
commit bf84e64ee9
4 changed files with 57 additions and 14 deletions

View File

@@ -0,0 +1,32 @@
#!/bin/sh
# docker-entrypoint.sh
# Ensures data directories have correct permissions on container startup
set -e
echo "Checking data directory permissions..."
# Directories that need to be writable by nodejs user (UID 1001)
DATA_DIRS="/app/data/backups /app/data/documents"
for dir in $DATA_DIRS; do
if [ ! -d "$dir" ]; then
echo "Creating directory: $dir"
mkdir -p "$dir"
fi
# Check if we can write to the directory
if ! touch "$dir/.write-test" 2>/dev/null; then
echo "WARNING: Cannot write to $dir"
echo "This may cause backup/document operations to fail"
echo "Fix: Run 'sudo chown -R 1001:1001 ./data' on the host"
else
rm "$dir/.write-test"
fi
done
echo "Permission checks complete"
echo "Starting application..."
# Execute the CMD from Dockerfile
exec "$@"