#!/bin/sh set -e # Ensure cache/media directory exists and is writable # This handles both mounted volumes and container-internal directories if [ ! -d "cache/media" ]; then mkdir -p cache/media || { echo "Error: Failed to create cache/media directory. Check permissions." >&2 exit 1 } fi # Ensure the cache directory is writable if [ ! -w "cache" ] || [ ! -w "cache/media" ]; then echo "Warning: Cache directory may not be writable. Check permissions on mounted volume." >&2 fi # Execute the main application exec "$@"