From a6f604078bc29239370266b7925f79b96881dfc4 Mon Sep 17 00:00:00 2001 From: surtic86 Date: Wed, 25 Feb 2026 20:34:16 +0100 Subject: [PATCH] Fix Docker build: add ext-zip, clean cache, fix DB_DATABASE default - Add php zip extension to Dockerfile (required by ZipArchive) - Remove bootstrap/cache/*.php during build to prevent stale dev-only service providers (e.g. BoostServiceProvider) from loading - Default DB_DATABASE to /app/database/database.sqlite in docker-compose.yml so env() fallback works correctly Co-Authored-By: Claude Opus 4.6 --- Dockerfile | 6 ++++-- docker-compose.yml | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2dd8414..64b6051 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,7 +45,8 @@ LABEL org.opencontainers.image.description="Self-hosted encrypted file sharing" # Install required PHP extensions RUN install-php-extensions \ intl \ - pcntl + pcntl \ + zip # Laravel environment defaults ENV APP_NAME="SealShare" \ @@ -80,8 +81,9 @@ COPY --from=vendor /app/vendor ./vendor # Copy built frontend assets from node stage COPY --from=assets /app/public/build ./public/build -# Remove dev/build files not needed in production +# Remove dev/build files and stale cache not needed in production RUN rm -rf node_modules tests .github docker/dev.Dockerfile docker/dev-entrypoint.sh .env .env.example \ + bootstrap/cache/*.php \ && mkdir -p storage/app/shares storage/app/public storage/framework/cache \ storage/framework/sessions storage/framework/testing storage/framework/views \ storage/logs database \ diff --git a/docker-compose.yml b/docker-compose.yml index 56d8e66..d323895 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,7 +23,7 @@ services: DB_CONNECTION: ${DB_CONNECTION:-sqlite} DB_HOST: ${DB_HOST:-} DB_PORT: ${DB_PORT:-} - DB_DATABASE: ${DB_DATABASE:-} + DB_DATABASE: ${DB_DATABASE:-/app/database/database.sqlite} DB_USERNAME: ${DB_USERNAME:-} DB_PASSWORD: ${DB_PASSWORD:-} LOG_CHANNEL: ${LOG_CHANNEL:-stderr} @@ -63,7 +63,7 @@ services: DB_CONNECTION: ${DB_CONNECTION:-sqlite} DB_HOST: ${DB_HOST:-} DB_PORT: ${DB_PORT:-} - DB_DATABASE: ${DB_DATABASE:-} + DB_DATABASE: ${DB_DATABASE:-/app/database/database.sqlite} DB_USERNAME: ${DB_USERNAME:-} DB_PASSWORD: ${DB_PASSWORD:-} LOG_CHANNEL: ${LOG_CHANNEL:-stderr}