use yarn
This commit is contained in:
+21
-9
@@ -1,14 +1,26 @@
|
||||
FROM node:20-alpine as build-stage
|
||||
FROM node:22-alpine AS build-stage
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm install --ignore-scripts=false --force
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM node:20-alpine as production-stage
|
||||
# Copy dependency files
|
||||
COPY package.json ./
|
||||
|
||||
# Install dependencies
|
||||
RUN yarn install --frozen-lockfile
|
||||
|
||||
# Copy source and build
|
||||
COPY . .
|
||||
RUN yarn build
|
||||
|
||||
# ---- Production Stage ----
|
||||
FROM node:22-alpine AS production-stage
|
||||
WORKDIR /app
|
||||
RUN npm rebuild --verbose sharp
|
||||
|
||||
# Copy only necessary files
|
||||
COPY --from=build-stage /app /app
|
||||
EXPOSE 3000
|
||||
|
||||
# Set environment
|
||||
ENV NODE_ENV=production
|
||||
CMD ["npm", "run", "start"]
|
||||
EXPOSE 3000
|
||||
|
||||
# Run with yarn
|
||||
CMD ["yarn", "start"]
|
||||
Reference in New Issue
Block a user