diff --git a/start.sh b/start.sh index 44d063e..4b95e3c 100644 --- a/start.sh +++ b/start.sh @@ -3,7 +3,7 @@ set -eu # Create necessary directories -mkdir -p /app/data/config /app/data/storage +mkdir -p /app/data/config /app/data/storage /app/data/nginx echo "==> DEBUG: Full repository structure at /app/code" find /app/code -type d -maxdepth 3 -not -path "*/node_modules/*" -not -path "*/\.*" | sort @@ -115,59 +115,65 @@ fi # Set up NGINX to serve the web apps and proxy to the Museum server echo "==> Setting up NGINX for web apps and API" -# Create NGINX configuration -mkdir -p /etc/nginx/sites-available /etc/nginx/sites-enabled +# Create a custom NGINX configuration in the writable data directory +cat > /app/data/nginx/ente.conf < /etc/nginx/sites-available/ente < Starting NGINX" -if command -v service &> /dev/null; then - service nginx restart || echo "Failed to restart nginx with service command" -else - /usr/sbin/nginx -s reload || /usr/sbin/nginx || echo "Failed to start nginx" -fi +echo "==> Custom NGINX configuration created at /app/data/nginx/ente.conf" # Looking for Museum (Go server component) echo "==> Looking for Museum (Go server component)" @@ -345,6 +351,6 @@ EOT fi fi -# Serve the static web apps in the foreground -echo "==> Running NGINX in the foreground" -exec nginx -g "daemon off;" \ No newline at end of file +# Serve the static web apps in the foreground using our custom nginx config +echo "==> Running NGINX in the foreground with custom configuration" +exec nginx -c /app/data/nginx/ente.conf \ No newline at end of file