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