use npm
This commit is contained in:
+6
-14
@@ -1,22 +1,14 @@
|
||||
# --- Base build + production image ---
|
||||
FROM node:20-slim AS app
|
||||
FROM node:20-alpine as build-stage
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies needed to build sharp
|
||||
RUN apt-get update && apt-get install -y \
|
||||
python3 \
|
||||
make \
|
||||
g++ \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy package files and install dependencies
|
||||
RUN apt-get update && apt-get install -y python3 make g++ git && rm -rf /var/lib/apt/lists/*
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
|
||||
# Copy project files and build
|
||||
RUN npm install --force
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM node:20-alpine as production-stage
|
||||
WORKDIR /app
|
||||
COPY --from=build-stage /app /app
|
||||
EXPOSE 3000
|
||||
ENV NODE_ENV=production
|
||||
CMD ["npm", "run", "start"]
|
||||
Reference in New Issue
Block a user