From 6ddb19fb3cebd333471f83f72fbb546ca5a41cdf Mon Sep 17 00:00:00 2001 From: Parsa Nazer Date: Mon, 10 Nov 2025 22:19:45 +0330 Subject: [PATCH] use yarn --- frontend/dockerfile | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/frontend/dockerfile b/frontend/dockerfile index 5f77df5..f72276d 100644 --- a/frontend/dockerfile +++ b/frontend/dockerfile @@ -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"] \ No newline at end of file