Install Node.js in Docker to build vendor assets
- 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 <noreply@anthropic.com>
This commit is contained in:
parent
c4fc59dc1e
commit
f4aabf56c0
2 changed files with 13 additions and 10 deletions
18
Dockerfile
18
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
|
||||
|
|
|
|||
5
mix.exs
5
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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue