-
Notifications
You must be signed in to change notification settings - Fork 10
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
Showing
1 changed file
with
34 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Stage 1: Build the application | ||
FROM node:18 AS builder | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Copy package.json and package-lock.json | ||
COPY package*.json ./ | ||
|
||
# Install dependencies | ||
RUN npm install --production | ||
|
||
# Copy the rest of the application code | ||
COPY . . | ||
|
||
# Build the TypeScript application | ||
RUN npm run build | ||
|
||
# Stage 2: Create the production image | ||
FROM node:18 AS production | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Copy only the necessary files from builder stage | ||
COPY --from=builder /app/dist ./dist | ||
COPY --from=builder /app/node_modules ./node_modules | ||
COPY --from=builder /app/package.json ./package.json | ||
|
||
# Expose the port if your bot needs to run on one | ||
EXPOSE 3000 | ||
|
||
# Command to run the bot | ||
CMD ["node", "dist/index.js"] |