Files
hossein-por-shop/frontend/dockerfile
Parsa Nazer 6ddb19fb3c use yarn
2025-11-10 22:19:45 +03:30

26 lines
441 B
Docker

FROM node:22-alpine AS build-stage
WORKDIR /app
# 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
# Copy only necessary files
COPY --from=build-stage /app /app
# Set environment
ENV NODE_ENV=production
EXPOSE 3000
# Run with yarn
CMD ["yarn", "start"]