Fix Docker build by using pre-bundled vendor assets

- 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 <noreply@anthropic.com>
This commit is contained in:
Graham McIntire 2025-07-21 12:41:27 -05:00
parent 63a87f3be1
commit 6944b9829c
No known key found for this signature in database
2 changed files with 11 additions and 2 deletions

View file

@ -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

View file

@ -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