add vite
Some checks failed
Build, Push and Deploy / build-and-push (push) Failing after 1m33s
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 1s

This commit is contained in:
eko
2026-03-29 13:48:35 +07:00
parent 7c985008d1
commit f1b383fbc7
2 changed files with 22 additions and 1 deletions

View File

@@ -12,6 +12,8 @@ RUN apk add --no-cache \
oniguruma-dev \ oniguruma-dev \
git \ git \
curl \ curl \
nodejs \
npm \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \ && docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) \ && docker-php-ext-install -j$(nproc) \
pdo_pgsql \ pdo_pgsql \
@@ -28,6 +30,13 @@ COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
WORKDIR /var/www/html WORKDIR /var/www/html
# Copy package files first for better caching
COPY package*.json ./
COPY vite.config.js ./
# Install NPM dependencies
RUN npm ci --no-audit --no-fund
# Copy application files # Copy application files
COPY --chown=www-data:www-data . . COPY --chown=www-data:www-data . .
@@ -41,7 +50,10 @@ RUN mkdir -p storage/framework/{cache,sessions,views} \
&& chmod -R 777 storage \ && chmod -R 777 storage \
&& chmod -R 777 bootstrap/cache && chmod -R 777 bootstrap/cache
# Install dependencies # Build Vite assets (this generates manifest.json)
RUN npm run build
# Install PHP dependencies
RUN composer install --no-dev --no-interaction --no-progress --optimize-autoloader --no-scripts \ RUN composer install --no-dev --no-interaction --no-progress --optimize-autoloader --no-scripts \
&& composer run-script post-autoload-dump \ && composer run-script post-autoload-dump \
&& php artisan package:discover --ansi || true && php artisan package:discover --ansi || true

View File

@@ -67,6 +67,15 @@ php artisan cache:clear || true
php artisan view:clear || true php artisan view:clear || true
php artisan route:clear || true php artisan route:clear || true
# Verify Vite manifest exists
if [ -f public/build/manifest.json ]; then
echo "✅ Vite manifest found at public/build/manifest.json"
else
echo "⚠️ Warning: Vite manifest not found! Assets may not load correctly."
echo "Current contents of public/build:"
ls -la public/build/ 2>/dev/null || echo "public/build directory does not exist"
fi
# Optional: Run migrations if needed # Optional: Run migrations if needed
# php artisan migrate --force # php artisan migrate --force