Deployment: Upgrade Dockerfile with multi-stage asset building, add Redis service and queue workers
This commit is contained in:
12
Dockerfile
12
Dockerfile
@@ -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} \
|
||||
|
||||
Reference in New Issue
Block a user