mirror of
https://github.com/lklynet/hypermind.git
synced 2026-05-03 17:40:29 +00:00
7db91bb594
Use slim base image and install build dependencies only when needed Rebuild native modules during install for production compatibility
25 lines
415 B
Docker
25 lines
415 B
Docker
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 ./
|
|
|
|
# Install dependencies with full rebuild
|
|
RUN npm install --production --build-from-source
|
|
|
|
COPY server.js ./
|
|
|
|
ENV PORT=3000
|
|
ENV NODE_ENV=production
|
|
|
|
EXPOSE 3000
|
|
|
|
CMD ["node", "server.js"]
|