Skip to content

Commit

Permalink
update dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Behzad-rabiei committed Oct 27, 2024
1 parent 32d1dd3 commit 6199521
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 37 deletions.
1 change: 0 additions & 1 deletion .github/workflows/bot-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:

build-push:
needs: [lint, test]
# needs: [lint]
uses: ./.github/workflows/build-push.yml
with:
app_name: "bot"
Expand Down
19 changes: 5 additions & 14 deletions bot/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Stage 1: Base Stage
FROM node:20-alpine AS base
WORKDIR /app
# COPY ./package-lock.json /app
COPY ./package.json /app
RUN npm install
COPY . .
Expand All @@ -10,24 +9,16 @@ RUN npm run build

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

# Stage 3: Test Stage
FROM base AS test
CMD [ "npx", "jest", "--coverage" ]

# # 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 /bot
# ENV NODE_ENV=production
# COPY --from=build /bot/dist ./dist
# RUN npm ci --only=production
# EXPOSE 3000
# CMD ["npm", "run", "start"]

# Stage 5: Production Stage
FROM base AS production
EXPOSE 3000
CMD ["npm", "run", "start"]
36 changes: 14 additions & 22 deletions hivemind-adapter/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,24 @@
# Dockerfile
# Stage 1: Build the application
FROM node:20-alpine AS builder
# Stage 1: Base Stage
FROM node:20-alpine AS base
WORKDIR /app
COPY package*.json ./
COPY ./package.json /app
RUN npm install
COPY . .
RUN npm run build

# Stage 2: Development
FROM node:20-alpine AS development
WORKDIR /app
COPY --from=builder /app .
RUN npm install --only=development

# Stage 2: Development Stage
FROM base AS development
EXPOSE 3000
CMD ["npm", "run", "start:dev"]

# Stage 3: Production
FROM node:20-alpine AS production
WORKDIR /app
COPY --from=builder /app .
COPY . .
RUN npm install --only=production --ignore-scripts
# Stage 3: Test Stage
FROM base AS test
CMD [ "npx", "jest", "--coverage" ]



# Stage 5: Production Stage
FROM base AS production
EXPOSE 3000
CMD ["node", "dist/main"]

# Stage 4: Testing
FROM node:20-alpine AS test
WORKDIR /app
COPY --from=builder /app .
RUN npm install --only=development
CMD [ "npx", "jest", "--coverage" ]

0 comments on commit 6199521

Please sign in to comment.