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:
@@ -55,8 +55,9 @@ RUN cd /app/code && \
|
|||||||
rm -rf node_modules && \
|
rm -rf node_modules && \
|
||||||
chown -R cloudron:cloudron /app/code/public
|
chown -R cloudron:cloudron /app/code/public
|
||||||
|
|
||||||
# Remove storage directory - will be symlinked to /app/data/storage in start.sh
|
# Remove storage directory and create symlink to /app/data/storage
|
||||||
RUN rm -rf /app/code/storage
|
RUN rm -rf /app/code/storage && \
|
||||||
|
ln -s /app/data/storage /app/code/storage
|
||||||
|
|
||||||
# Copy configuration files
|
# Copy configuration files
|
||||||
COPY nginx.conf /etc/nginx/sites-available/default
|
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 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 && \
|
||||||
|
|||||||
Reference in New Issue
Block a user