From 45f11105ab9163e38884da20cb472513f9171b52 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 22 Oct 2025 09:43:51 -0600 Subject: [PATCH] Fix: Create .env symlink in Dockerfile and add APP_KEY placeholder - Create symlink from /app/code/.env to /app/data/.env in Dockerfile - Add APP_KEY= placeholder to .env template - Remove runtime symlink creation attempts - This fixes key:generate error about missing .env file --- Dockerfile | 3 ++- start.sh | 11 ++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8515819..c47ef17 100644 --- a/Dockerfile +++ b/Dockerfile @@ -57,7 +57,8 @@ RUN cd /app/code && \ # Remove storage directory and create symlink to /app/data/storage RUN rm -rf /app/code/storage && \ - ln -s /app/data/storage /app/code/storage + ln -s /app/data/storage /app/code/storage && \ + ln -s /app/data/.env /app/code/.env # Copy configuration files COPY nginx.conf /etc/nginx/sites-available/default diff --git a/start.sh b/start.sh index ae9aa23..b816e7c 100644 --- a/start.sh +++ b/start.sh @@ -18,6 +18,7 @@ chmod -R 755 /app/data/storage echo "==> Configuring application environment" cat > /app/data/.env </dev/null || true +# Set proper ownership +chown cloudron:cloudron /app/data/.env +chmod 640 /app/data/.env # Generate APP_KEY if it doesn't exist if [ ! -f "/app/data/app_key" ]; then @@ -98,10 +99,6 @@ else echo "ANONADDY_SECRET=${ANONADDY_SECRET}" >> /app/data/.env fi -# Set proper ownership -chown cloudron:cloudron /app/data/.env -chmod 640 /app/data/.env - # Run database migrations echo "==> Running database migrations" cd /app/code