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