CatPtain commited on
Commit
e6e4558
·
verified ·
1 Parent(s): ca8657b

Upload 2 files

Browse files
Files changed (2) hide show
  1. Dockerfile +2 -5
  2. start-hf.sh +6 -3
Dockerfile CHANGED
@@ -111,11 +111,8 @@ RUN mkdir -p /var/www/html/wp-content/database && \
111
  mkdir -p /var/www/html/wp-content/uploads && \
112
  mkdir -p /var/www/html/wp-content/cache && \
113
  chown -R www-data:www-data /var/www/html && \
114
- chmod -R 755 /var/www/html && \
115
- chmod 644 /var/www/html/.htaccess && \
116
- chmod 777 /var/www/html/wp-content/uploads && \
117
- chmod 777 /var/www/html/wp-content/database && \
118
- chmod 777 /var/www/html/wp-content/cache
119
 
120
  # Add user for HF Spaces compatibility
121
  RUN usermod -u 1000 www-data && groupmod -g 1000 www-data
 
111
  mkdir -p /var/www/html/wp-content/uploads && \
112
  mkdir -p /var/www/html/wp-content/cache && \
113
  chown -R www-data:www-data /var/www/html && \
114
+ chmod -R 777 /var/www/html && \
115
+ chmod 644 /var/www/html/.htaccess
 
 
 
116
 
117
  # Add user for HF Spaces compatibility
118
  RUN usermod -u 1000 www-data && groupmod -g 1000 www-data
start-hf.sh CHANGED
@@ -9,6 +9,7 @@ test -d /var/www/html/wp-content/uploads || mkdir -p /var/www/html/wp-content/up
9
  test -d /var/www/html/wp-content/cache || mkdir -p /var/www/html/wp-content/cache
10
 
11
  # Ensure proper permissions (fallback)
 
12
  chmod 777 /var/www/html/wp-content/uploads 2>/dev/null || true
13
  chmod 777 /var/www/html/wp-content/database 2>/dev/null || true
14
  chmod 777 /var/www/html/wp-content/cache 2>/dev/null || true
@@ -25,8 +26,9 @@ if [ ! -f "/var/www/html/wp-content/database/wordpress.db" ]; then
25
  echo "Database will be initialized on first visit"
26
  fi
27
 
28
- # Create a simple index.html for health check
29
- cat > /var/www/html/health.html << 'EOF'
 
30
  <!DOCTYPE html>
31
  <html>
32
  <head>
@@ -60,7 +62,8 @@ cat > /var/www/html/health.html << 'EOF'
60
  EOF
61
 
62
  # Create demo content script
63
- cat > /var/www/html/wp-content/demo-setup.php << 'EOF'
 
64
  <?php
65
  /**
66
  * Demo content setup for WordPress on HF Spaces
 
9
  test -d /var/www/html/wp-content/cache || mkdir -p /var/www/html/wp-content/cache
10
 
11
  # Ensure proper permissions (fallback)
12
+ chmod 777 /var/www/html 2>/dev/null || true
13
  chmod 777 /var/www/html/wp-content/uploads 2>/dev/null || true
14
  chmod 777 /var/www/html/wp-content/database 2>/dev/null || true
15
  chmod 777 /var/www/html/wp-content/cache 2>/dev/null || true
 
26
  echo "Database will be initialized on first visit"
27
  fi
28
 
29
+ # Create a simple health check file
30
+ echo "Creating health check file..."
31
+ cat > /var/www/html/health.html << 'EOF' || { echo "Warning: Could not create health.html"; touch /var/www/html/health.html 2>/dev/null || true; }
32
  <!DOCTYPE html>
33
  <html>
34
  <head>
 
62
  EOF
63
 
64
  # Create demo content script
65
+ echo "Creating demo setup script..."
66
+ cat > /var/www/html/wp-content/demo-setup.php << 'EOF' || { echo "Warning: Could not create demo-setup.php"; }
67
  <?php
68
  /**
69
  * Demo content setup for WordPress on HF Spaces