40 - Fix Livewire assets and Caddy config for production
All checks were successful
Build and Push Docker Image / build (push) Successful in 4m2s

This commit is contained in:
myrmidex 2026-03-07 00:57:47 +01:00
parent 7b3a59da10
commit b9d9fd66d8

View file

@ -31,11 +31,11 @@ RUN npm run build
# Remove node_modules after build to save space
RUN rm -rf node_modules
# Publish Livewire assets and Laravel optimizations
RUN php artisan livewire:publish --assets \
&& php artisan config:cache \
&& php artisan route:cache \
&& php artisan view:cache \
# Publish Livewire assets
RUN php artisan livewire:publish --assets
# Laravel optimizations (skip config and route cache - they need runtime env vars)
RUN php artisan view:cache \
&& composer dump-autoload --optimize
# Set permissions
@ -51,13 +51,9 @@ RUN cat > /etc/caddy/Caddyfile <<EOF
:8000 {
root * /app/public
php_server {
index index.php
}
encode gzip
file_server
php_server
header {
X-Frame-Options "SAMEORIGIN"
@ -90,6 +86,10 @@ for i in $(seq 1 30); do
sleep 2
done
# Cache config with runtime env vars
echo "Caching configuration..."
php artisan config:cache
# Run migrations
echo "Running migrations..."
php artisan migrate --force || echo "Migrations failed or already up-to-date"