fix(docker): sync compiled frontend assets directly from git and optimize docker build
This commit is contained in:
+2
-25
@@ -1,25 +1,5 @@
|
|||||||
# =========================================================================
|
# =========================================================================
|
||||||
# STAGE 1: Frontend Asset Compilation via Vite & Node.js
|
# PHP 8.3-FPM Alpine Production Runtime
|
||||||
# =========================================================================
|
|
||||||
FROM node:22-alpine AS frontend-builder
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Copy dependency manifests
|
|
||||||
COPY package.json package-lock.json* ./
|
|
||||||
|
|
||||||
# Install dependencies
|
|
||||||
RUN npm ci || npm install
|
|
||||||
|
|
||||||
# Copy source assets needed for compilation
|
|
||||||
COPY vite.config.js ./
|
|
||||||
COPY resources/ ./resources/
|
|
||||||
|
|
||||||
# Compile production assets into /app/public/build
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
# =========================================================================
|
|
||||||
# STAGE 2: PHP 8.3-FPM Alpine Production Runtime
|
|
||||||
# =========================================================================
|
# =========================================================================
|
||||||
FROM php:8.3-fpm-alpine AS app
|
FROM php:8.3-fpm-alpine AS app
|
||||||
|
|
||||||
@@ -63,12 +43,9 @@ COPY docker/entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
|||||||
RUN sed -i 's/\r$//' /usr/local/bin/docker-entrypoint.sh \
|
RUN sed -i 's/\r$//' /usr/local/bin/docker-entrypoint.sh \
|
||||||
&& chmod +x /usr/local/bin/docker-entrypoint.sh
|
&& chmod +x /usr/local/bin/docker-entrypoint.sh
|
||||||
|
|
||||||
# Copy application source code
|
# Copy application source code (termasuk public/build pre-compiled dari git)
|
||||||
COPY . /var/www
|
COPY . /var/www
|
||||||
|
|
||||||
# Copy compiled frontend assets from Stage 1 (Overrides public/build)
|
|
||||||
COPY --from=frontend-builder /app/public/build /var/www/public/build
|
|
||||||
|
|
||||||
# Install Composer production dependencies
|
# Install Composer production dependencies
|
||||||
RUN composer install --no-dev --optimize-autoloader --no-interaction
|
RUN composer install --no-dev --optimize-autoloader --no-interaction
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"resources/css/app.css": {
|
"resources/css/app.css": {
|
||||||
"file": "assets/app-CSwKW6_z.css",
|
"file": "assets/app-CmcfnDoH.css",
|
||||||
"src": "resources/css/app.css",
|
"src": "resources/css/app.css",
|
||||||
"isEntry": true,
|
"isEntry": true,
|
||||||
"name": "app",
|
"name": "app",
|
||||||
|
|||||||
Reference in New Issue
Block a user