-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d3c49ac
commit f7fbe1f
Showing
1 changed file
with
15 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |