fix dockerfile
Some checks failed
Build, Push and Deploy / build-and-push (push) Failing after 1m52s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 8s
Build, Push and Deploy / deploy-staging (push) Has been skipped
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
Some checks failed
Build, Push and Deploy / build-and-push (push) Failing after 1m52s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 8s
Build, Push and Deploy / deploy-staging (push) Has been skipped
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
This commit is contained in:
26
Dockerfile
26
Dockerfile
@@ -33,7 +33,24 @@ WORKDIR /var/www/html
|
||||
# Copy composer files first
|
||||
COPY composer.json composer.lock ./
|
||||
|
||||
# Install PHP dependencies (remove --no-scripts flag)
|
||||
# Create missing Helper.php file before composer install
|
||||
RUN mkdir -p app/Helpers && \
|
||||
cat > app/Helpers/Helper.php << 'EOF'
|
||||
<?php
|
||||
|
||||
namespace App\Helpers;
|
||||
|
||||
class Helper
|
||||
{
|
||||
// Add your helper functions here
|
||||
public static function example()
|
||||
{
|
||||
return "Helper loaded";
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
# Install PHP dependencies
|
||||
RUN composer install --no-interaction --no-progress --optimize-autoloader
|
||||
|
||||
# Copy package files for NPM
|
||||
@@ -43,7 +60,7 @@ COPY vite.config.js ./
|
||||
# Install NPM dependencies
|
||||
RUN npm install --legacy-peer-deps --no-audit
|
||||
|
||||
# Copy application files
|
||||
# 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
|
||||
@@ -59,15 +76,12 @@ RUN mkdir -p storage/framework/{cache,sessions,views} \
|
||||
# Build Vite assets
|
||||
RUN npm run build
|
||||
|
||||
# Run package discovery and other post-install commands
|
||||
# Run package discovery
|
||||
RUN php artisan package:discover --ansi || true
|
||||
|
||||
# Generate application key
|
||||
RUN php artisan key:generate --no-interaction --force || true
|
||||
|
||||
# Cache configurations for production
|
||||
RUN php artisan config:cache || true
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
|
||||
Reference in New Issue
Block a user