mirror of
https://github.com/lklynet/hypermind.git
synced 2026-05-03 09:30:36 +00:00
build(docker): optimize docker image size and build process
Use slim base image and install build dependencies only when needed Rebuild native modules during install for production compatibility
This commit is contained in:
+10
-2
@@ -1,10 +1,18 @@
|
||||
FROM node:18
|
||||
FROM node:18-bullseye-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install build dependencies for native modules
|
||||
RUN apt-get update && apt-get install -y \
|
||||
python3 \
|
||||
make \
|
||||
g++ \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY package*.json ./
|
||||
|
||||
RUN npm install --production
|
||||
# Install dependencies with full rebuild
|
||||
RUN npm install --production --build-from-source
|
||||
|
||||
COPY server.js ./
|
||||
|
||||
|
||||
Reference in New Issue
Block a user