Fix: Create storage symlink during Docker build

- Create symlink from /app/code/storage to /app/data/storage in Dockerfile
- Symlink is created during build when filesystem is writable
- Removed Laravel paths override approach
- Deleted unused laravel-paths.php file
This commit is contained in:
Your Name
2025-10-22 09:27:32 -06:00
parent 2de73967a4
commit 5ce6457d5f

View File

@@ -55,8 +55,9 @@ RUN cd /app/code && \
rm -rf node_modules && \
chown -R cloudron:cloudron /app/code/public
# Remove storage directory - will be symlinked to /app/data/storage in start.sh
RUN rm -rf /app/code/storage
# Remove storage directory and create symlink to /app/data/storage
RUN rm -rf /app/code/storage && \
ln -s /app/data/storage /app/code/storage
# Copy configuration files
COPY nginx.conf /etc/nginx/sites-available/default
@@ -64,10 +65,6 @@ COPY supervisor.conf /etc/supervisor/conf.d/anonaddy.conf
COPY start.sh /app/code/start.sh
COPY postfix-main.cf /tmp/postfix-main.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
RUN mkdir -p /tmp/data && \