fix docker
Some checks failed
Build, Push and Deploy / build-and-push (push) Failing after 1m51s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 9s
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 1m51s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 9s
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:
42
Dockerfile
42
Dockerfile
@@ -30,27 +30,20 @@ COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
|||||||
|
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
# Copy composer files first
|
# Copy ALL application files first (including artisan)
|
||||||
COPY composer.json composer.lock ./
|
COPY --chown=www-data:www-data . .
|
||||||
|
|
||||||
# Create missing Helper.php file before composer install
|
# Remove any nested vendor directories to avoid conflicts
|
||||||
RUN mkdir -p app/Helpers && \
|
RUN find . -type d -name "vendor" -not -path "./vendor*" -exec rm -rf {} + 2>/dev/null || true
|
||||||
cat > app/Helpers/Helper.php << 'EOF'
|
|
||||||
<?php
|
|
||||||
|
|
||||||
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
|
# Install PHP dependencies (artisan file now exists)
|
||||||
{
|
|
||||||
// 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
|
RUN composer install --no-interaction --no-progress --optimize-autoloader
|
||||||
|
|
||||||
# Copy package files for NPM
|
# Copy package files for NPM
|
||||||
@@ -60,19 +53,6 @@ COPY vite.config.js ./
|
|||||||
# Install NPM dependencies
|
# Install NPM dependencies
|
||||||
RUN npm install --legacy-peer-deps --no-audit
|
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
|
# Build Vite assets
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user