Skip to content

Commit

Permalink
bot: fix dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Behzad-rabiei committed Oct 24, 2024
1 parent d3c49ac commit f7fbe1f
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions bot/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
# Stage 1: Base Stage
FROM node:18-alpine AS base
WORKDIR /app
COPY package.json /app
FROM node:18 AS base
WORKDIR /bot
COPY /bot/package.json .
RUN npm install
COPY /bot .
RUN npm run build


# Stage 2: Development Stage
FROM base AS development
ENV NODE_ENV=development
RUN npm install
EXPOSE 3000
CMD ["npm", "run", "dev"]

# Stage 3: Test Stage
FROM base AS test
ENV NODE_ENV=test
RUN npm install
CMD ["npm", "run", "test"]

# Stage 4: Build Stage
FROM base AS build
ENV NODE_ENV=production
RUN npm run build

# Stage 5: Production Stage
FROM node:18-alpine AS production
WORKDIR /app
ENV NODE_ENV=production
COPY --from=build /app/dist ./dist
RUN npm ci --only=production
EXPOSE 3000
CMD ["npm", "run", "start"]
# # Stage 5: Production Stage
# FROM node:18-alpine AS production
# WORKDIR /bot
# ENV NODE_ENV=production
# COPY --from=build /bot/dist ./dist
# RUN npm ci --only=production
# EXPOSE 3000
# CMD ["npm", "run", "start"]

0 comments on commit f7fbe1f

Please sign in to comment.