Skip to content

Commit

Permalink
feat: add dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
perzeuss committed Aug 13, 2024
1 parent cd10f19 commit 423f356
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Dockerfile
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"]

0 comments on commit 423f356

Please sign in to comment.