diff --git a/Dockerfile b/Dockerfile index 569c9b4..9945b94 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ FROM node:20-alpine AS base ENV TZ=Asia/Tehran -ENV NODE_ENV=production RUN apk add --no-cache tzdata RUN corepack enable @@ -10,14 +9,16 @@ WORKDIR /app # ----------------------- -# Install ALL dependencies (important for build) +# Install ALL dependencies (dev + prod) for the build # ----------------------- FROM base AS deps COPY package.json yarn.lock ./ -# IMPORTANT: force devDependencies inclusion -RUN yarn install --frozen-lockfile --production=false +# NODE_ENV must not be "production" here — otherwise devDependencies +# (e.g. @nestjs/cli) are skipped and "nest build" fails. +ENV NODE_ENV=development +RUN yarn install --frozen-lockfile # ----------------------- @@ -27,17 +28,12 @@ FROM base AS builder WORKDIR /app +ENV NODE_ENV=development + COPY package.json yarn.lock nest-cli.json tsconfig.json tsconfig.build.json ./ COPY --from=deps /app/node_modules ./node_modules COPY src ./src -# 🔥 GUARANTEE nest CLI exists (fixes your error) -RUN yarn add -D @nestjs/cli - -# 🔥 SAFETY CHECK (optional but helpful) -RUN npx nest --version - -# Build RUN yarn build \ && mkdir -p dist/config \ && cp src/config/swagger.json dist/config/ @@ -50,6 +46,7 @@ FROM base AS prod-deps COPY package.json yarn.lock ./ +ENV NODE_ENV=production RUN yarn install --frozen-lockfile --production=true @@ -72,4 +69,4 @@ USER appuser EXPOSE 3000 -CMD ["node", "dist/main"] \ No newline at end of file +CMD ["node", "dist/main"] diff --git a/delearn.archive b/delearn.archive new file mode 100644 index 0000000..26bc8f8 Binary files /dev/null and b/delearn.archive differ