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:
parent
63a87f3be1
commit
6944b9829c
2 changed files with 11 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
5
mix.exs
5
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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue