diff --git a/Dockerfile b/Dockerfile index f3c0a801..486dcbde 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,27 +30,20 @@ COPY --from=composer:latest /usr/bin/composer /usr/bin/composer WORKDIR /var/www/html -# Copy composer files first -COPY composer.json composer.lock ./ +# Copy ALL application files first (including artisan) +COPY --chown=www-data:www-data . . -# Create missing Helper.php file before composer install -RUN mkdir -p app/Helpers && \ - cat > app/Helpers/Helper.php << 'EOF' -/dev/null || true -namespace App\Helpers; +# Create necessary directories +RUN mkdir -p storage/framework/{cache,sessions,views} \ + && mkdir -p storage/logs \ + && mkdir -p bootstrap/cache \ + && chmod -R 777 storage \ + && chmod -R 777 bootstrap/cache -class Helper -{ - // Add your helper functions here - public static function example() - { - return "Helper loaded"; - } -} -EOF - -# Install PHP dependencies +# Install PHP dependencies (artisan file now exists) RUN composer install --no-interaction --no-progress --optimize-autoloader # Copy package files for NPM @@ -60,19 +53,6 @@ COPY vite.config.js ./ # Install NPM dependencies RUN npm install --legacy-peer-deps --no-audit -# Copy application files (this will overwrite the placeholder Helper.php if exists) -COPY --chown=www-data:www-data . . - -# Remove any nested vendor directories to avoid conflicts -RUN find . -type d -name "vendor" -not -path "./vendor*" -exec rm -rf {} + 2>/dev/null || true - -# Create all necessary directories -RUN mkdir -p storage/framework/{cache,sessions,views} \ - && mkdir -p storage/logs \ - && mkdir -p bootstrap/cache \ - && chmod -R 777 storage \ - && chmod -R 777 bootstrap/cache - # Build Vite assets RUN npm run build