diff --git a/.github/workflows/coolify-staging-build.yml b/.github/workflows/coolify-staging-build.yml index 494ef6939..11e5dff9d 100644 --- a/.github/workflows/coolify-staging-build.yml +++ b/.github/workflows/coolify-staging-build.yml @@ -80,7 +80,9 @@ jobs: cache-from: | type=gha,scope=build-${{ matrix.arch }} type=registry,ref=${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-${{ matrix.arch }} - cache-to: type=gha,mode=max,scope=build-${{ matrix.arch }} + cache-to: | + type=gha,mode=max,scope=build-${{ matrix.arch }} + type=registry,ref=${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-${{ matrix.arch }},mode=max merge-manifest: runs-on: ubuntu-24.04 diff --git a/docker/production/Dockerfile b/docker/production/Dockerfile index 2ce8c834e..65f062d2d 100644 --- a/docker/production/Dockerfile +++ b/docker/production/Dockerfile @@ -38,10 +38,24 @@ USER www-data FROM node:24-alpine AS static-assets WORKDIR /app -COPY package*.json vite.config.js postcss.config.cjs ./ + +# Layer 1: Package dependencies (rarely changes) +COPY package*.json ./ RUN --mount=type=cache,target=/root/.npm \ npm ci -COPY . . + +# Layer 2: Build config (rarely changes) +COPY vite.config.js postcss.config.cjs ./ + +# Layer 3: Frontend source files +COPY resources/css/ ./resources/css/ +COPY resources/js/ ./resources/js/ +COPY resources/fonts/ ./resources/fonts/ + +# Layer 4: Blade templates for Tailwind class detection +COPY resources/views/ ./resources/views/ + +# Build frontend assets RUN npm run build # =================================================================