Deployment: Upgrade Dockerfile with multi-stage asset building, add Redis service and queue workers

This commit is contained in:
2026-05-21 04:00:30 +00:00
parent fc9158b928
commit ffbfde943c
4 changed files with 45 additions and 2 deletions

View File

@@ -1,3 +1,12 @@
# Stage 1: Build front-end assets
FROM node:22-alpine AS assets-builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# Stage 2: Production PHP FPM + Nginx image
FROM php:8.3-fpm-alpine AS base
RUN apk add --no-cache \
@@ -36,6 +45,9 @@ RUN composer install --no-dev --no-interaction --no-autoloader --no-scripts --pr
COPY . .
# Copy Vite compiled assets
COPY --from=assets-builder /app/public/build ./public/build
RUN composer dump-autoload --optimize --no-dev \
&& mkdir -p storage/app/private/feedback-attachments \
&& mkdir -p storage/framework/{cache,sessions,views} \