From d3c49acafe643f3ffc29bb3684f64207d4ad66e5 Mon Sep 17 00:00:00 2001 From: Behzad Rabiei Date: Thu, 24 Oct 2024 16:55:33 +0400 Subject: [PATCH] bot: fix workdir --- bot/Dockerfile | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/bot/Dockerfile b/bot/Dockerfile index bce5b0bd..1cf20804 100644 --- a/bot/Dockerfile +++ b/bot/Dockerfile @@ -1,48 +1,31 @@ # Stage 1: Base Stage FROM node:18-alpine AS base WORKDIR /app - -# Copy package files and install dependencies -COPY package*.json ./ -RUN npm ci - -# Copy the rest of the application files -COPY . . +COPY package.json /app # Stage 2: Development Stage FROM base AS development ENV NODE_ENV=development -# Install development dependencies RUN npm install -# Expose port if necessary EXPOSE 3000 -# Start the development server CMD ["npm", "run", "dev"] # Stage 3: Test Stage FROM base AS test ENV NODE_ENV=test -# Install development dependencies RUN npm install -# Run tests CMD ["npm", "run", "test"] # Stage 4: Build Stage FROM base AS build ENV NODE_ENV=production -# Build the application (TypeScript compilation) RUN npm run build # Stage 5: Production Stage FROM node:18-alpine AS production WORKDIR /app ENV NODE_ENV=production -# Copy only necessary files from the build stage COPY --from=build /app/dist ./dist -COPY package*.json ./ -# Install only production dependencies RUN npm ci --only=production -# Expose port if necessary EXPOSE 3000 -# Start the application CMD ["npm", "run", "start"]