From f4aabf56c064ba6f48a6f585d8acbc2001ff817d Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Mon, 21 Jul 2025 12:57:46 -0500 Subject: [PATCH] Install Node.js in Docker to build vendor assets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add Node.js installation to Dockerfile - Run npm install to get dependencies - Build vendor bundle during Docker build - Remove unnecessary assets.deploy.prod alias This ensures all JavaScript dependencies are available during the build process. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- Dockerfile | 18 +++++++++++++----- mix.exs | 5 ----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 41f5c57..34fd015 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,12 +50,20 @@ COPY priv/gleam priv/gleam # Compile Gleam files (using pre-compiled BEAM files) RUN mix gleam_compile -# Copy pre-bundled vendor assets -COPY priv/static/assets/vendor.js priv/static/assets/ -COPY priv/static/assets/vendor.css priv/static/assets/ +# Install Node.js for asset building +RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ + apt-get install -y nodejs && \ + apt-get clean && rm -rf /var/lib/apt/lists/* -# Compile assets (using prod alias that skips vendor bundling) -RUN mix assets.deploy.prod +# Install npm dependencies +WORKDIR /app/assets +RUN npm install + +# Go back to app root +WORKDIR /app + +# Compile assets +RUN mix assets.deploy # Compile and release RUN mix release --path /app/release diff --git a/mix.exs b/mix.exs index 6b1f76c..c113ec8 100644 --- a/mix.exs +++ b/mix.exs @@ -138,11 +138,6 @@ defmodule Aprsme.MixProject do "esbuild vendor", "esbuild default --minify", "phx.digest" - ], - "assets.deploy.prod": [ - "tailwind default --minify", - "esbuild default --minify", - "phx.digest" ] ] end