From 6944b9829c912a39234753a62269eea70391be05 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Mon, 21 Jul 2025 12:41:27 -0500 Subject: [PATCH] Fix Docker build by using pre-bundled vendor assets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add new mix alias 'assets.deploy.prod' that skips vendor bundling - Copy pre-bundled vendor.js and vendor.css files in Dockerfile - Prevents esbuild errors when npm packages aren't available during build 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- Dockerfile | 8 ++++++-- mix.exs | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 515be89..41f5c57 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,8 +50,12 @@ COPY priv/gleam priv/gleam # Compile Gleam files (using pre-compiled BEAM files) RUN mix gleam_compile -# Compile assets -RUN mix assets.deploy +# Copy pre-bundled vendor assets +COPY priv/static/assets/vendor.js priv/static/assets/ +COPY priv/static/assets/vendor.css priv/static/assets/ + +# Compile assets (using prod alias that skips vendor bundling) +RUN mix assets.deploy.prod # Compile and release RUN mix release --path /app/release diff --git a/mix.exs b/mix.exs index c113ec8..6b1f76c 100644 --- a/mix.exs +++ b/mix.exs @@ -138,6 +138,11 @@ defmodule Aprsme.MixProject do "esbuild vendor", "esbuild default --minify", "phx.digest" + ], + "assets.deploy.prod": [ + "tailwind default --minify", + "esbuild default --minify", + "phx.digest" ] ] end