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)
|
# Compile Gleam files (using pre-compiled BEAM files)
|
||||||
RUN mix gleam_compile
|
RUN mix gleam_compile
|
||||||
|
|
||||||
# Copy pre-bundled vendor assets
|
# Install Node.js for asset building
|
||||||
COPY priv/static/assets/vendor.js priv/static/assets/
|
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
||||||
COPY priv/static/assets/vendor.css priv/static/assets/
|
apt-get install -y nodejs && \
|
||||||
|
apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Compile assets (using prod alias that skips vendor bundling)
|
# Install npm dependencies
|
||||||
RUN mix assets.deploy.prod
|
WORKDIR /app/assets
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
# Go back to app root
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Compile assets
|
||||||
|
RUN mix assets.deploy
|
||||||
|
|
||||||
# Compile and release
|
# Compile and release
|
||||||
RUN mix release --path /app/release
|
RUN mix release --path /app/release
|
||||||
|
|
|
||||||
5
mix.exs
5
mix.exs
|
|
@ -138,11 +138,6 @@ defmodule Aprsme.MixProject do
|
||||||
"esbuild vendor",
|
"esbuild vendor",
|
||||||
"esbuild default --minify",
|
"esbuild default --minify",
|
||||||
"phx.digest"
|
"phx.digest"
|
||||||
],
|
|
||||||
"assets.deploy.prod": [
|
|
||||||
"tailwind default --minify",
|
|
||||||
"esbuild default --minify",
|
|
||||||
"phx.digest"
|
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue