Fix: Configure Laravel to use /app/data/storage
- Created laravel-paths.php to override storage path - Patched bootstrap/app.php to load custom paths - Removed symlink approach as /app/code is read-only - Laravel will now use /app/data/storage directly
This commit is contained in:
@@ -64,6 +64,10 @@ COPY supervisor.conf /etc/supervisor/conf.d/anonaddy.conf
|
|||||||
COPY start.sh /app/code/start.sh
|
COPY start.sh /app/code/start.sh
|
||||||
COPY postfix-main.cf /tmp/postfix-main.cf
|
COPY postfix-main.cf /tmp/postfix-main.cf
|
||||||
COPY postfix-master.cf /tmp/postfix-master.cf
|
COPY postfix-master.cf /tmp/postfix-master.cf
|
||||||
|
COPY laravel-paths.php /app/code/laravel-paths.php
|
||||||
|
|
||||||
|
# Patch bootstrap/app.php to use custom storage paths
|
||||||
|
RUN sed -i '/\$app = new Illuminate/a require_once __DIR__.'\''/laravel-paths.php'\'';' /app/code/bootstrap/app.php
|
||||||
|
|
||||||
# Initialize data directory structure
|
# Initialize data directory structure
|
||||||
RUN mkdir -p /tmp/data && \
|
RUN mkdir -p /tmp/data && \
|
||||||
|
|||||||
8
laravel-paths.php
Normal file
8
laravel-paths.php
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Override Laravel storage paths for Cloudron
|
||||||
|
* This file is loaded before the application boots to redirect storage to /app/data
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Override storage path to use /app/data/storage instead of /app/code/storage
|
||||||
|
$app->useStoragePath('/app/data/storage');
|
||||||
3
start.sh
3
start.sh
@@ -14,9 +14,6 @@ fi
|
|||||||
chown -R cloudron:cloudron /app/data
|
chown -R cloudron:cloudron /app/data
|
||||||
chmod -R 755 /app/data/storage
|
chmod -R 755 /app/data/storage
|
||||||
|
|
||||||
# Create symlink from /app/code/storage to /app/data/storage
|
|
||||||
ln -sf /app/data/storage /app/code/storage
|
|
||||||
|
|
||||||
# Create .env file in /app/data
|
# Create .env file in /app/data
|
||||||
echo "==> Configuring application environment"
|
echo "==> Configuring application environment"
|
||||||
cat > /app/data/.env <<EOF
|
cat > /app/data/.env <<EOF
|
||||||
|
|||||||
Reference in New Issue
Block a user