fix dockerfile
Some checks failed
Build, Push and Deploy / build-and-push (push) Failing after 1m49s
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 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 0s

This commit is contained in:
eko
2026-03-29 14:32:03 +07:00
parent 0be65d8013
commit 30a3f05cbb

View File

@@ -30,12 +30,18 @@ COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
WORKDIR /var/www/html
# Copy package files first for better caching
# Copy composer files first
COPY composer.json composer.lock ./
# Install PHP dependencies (remove --no-scripts flag)
RUN composer install --no-interaction --no-progress --optimize-autoloader
# Copy package files for NPM
COPY package*.json ./
COPY vite.config.js ./
# Install NPM dependencies
RUN npm ci --no-audit --no-fund
RUN npm install --legacy-peer-deps --no-audit
# Copy application files
COPY --chown=www-data:www-data . .
@@ -50,17 +56,18 @@ RUN mkdir -p storage/framework/{cache,sessions,views} \
&& chmod -R 777 storage \
&& chmod -R 777 bootstrap/cache
# Build Vite assets (this generates manifest.json)
# Build Vite assets
RUN npm run build
# Install PHP dependencies
RUN composer install --no-dev --no-interaction --no-progress --optimize-autoloader --no-scripts \
&& composer run-script post-autoload-dump \
&& php artisan package:discover --ansi || true
# Run package discovery and other post-install commands
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