Remove Node.js from Docker build
- Phoenix uses standalone ESBuild and Tailwind binaries - No npm dependencies needed (package.json was empty) - Removes ~150MB from Docker image - Speeds up build time by removing Node.js installation step Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
1605afd5b0
commit
52716da109
3 changed files with 5 additions and 28 deletions
|
|
@ -39,9 +39,11 @@ This is an Elixir Phoenix LiveView application that serves as a real-time APRS (
|
|||
- **CRITICAL**: ALWAYS run `mix format` BEFORE committing - never commit unformatted code
|
||||
- **MANDATORY**: Run `mix compile --warnings-as-errors` and ensure it passes before considering any task complete
|
||||
|
||||
### Assets (No Node.js)
|
||||
### Assets (No Node.js Required)
|
||||
- `mix assets.deploy` - Build and minify frontend assets (Tailwind CSS + ESBuild)
|
||||
- Phoenix uses ESBuild directly without Node.js package managers
|
||||
- Phoenix uses standalone ESBuild and Tailwind binaries - no npm/yarn needed
|
||||
- JavaScript bundling handled by ESBuild
|
||||
- CSS compilation handled by Tailwind CLI
|
||||
|
||||
## Architecture
|
||||
|
||||
|
|
|
|||
14
Dockerfile
14
Dockerfile
|
|
@ -63,19 +63,7 @@ RUN mkdir -p _build/prod/lib/aprsme/ebin && \
|
|||
# Now compile the main application
|
||||
RUN mix compile
|
||||
|
||||
# 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/*
|
||||
|
||||
# Install npm dependencies
|
||||
WORKDIR /app/assets
|
||||
RUN npm install
|
||||
|
||||
# Go back to app root
|
||||
WORKDIR /app
|
||||
|
||||
# Compile assets
|
||||
# Compile assets using ESBuild and Tailwind (no Node.js needed)
|
||||
RUN mix assets.deploy
|
||||
|
||||
# Compile and release
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
{
|
||||
"dependencies": {},
|
||||
"name": "assets",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"description": ""
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue