Skip to content

Commit

Permalink
refactor: ♻️ testing dockerfile update
Browse files Browse the repository at this point in the history
  • Loading branch information
slugb0t committed Jul 11, 2024
1 parent 28c515e commit c3a3728
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions bot/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
# Start from a slim Node.js base image
FROM node:20-slim

# Set the working directory inside the container
WORKDIR /usr/src/app
COPY package.json package-lock.json ./
RUN npm ci --production
RUN npm cache clean --force

# Install pnpm globally
RUN npm install -g pnpm

# Copy package.json and pnpm-lock.yaml (or pnpmfile.js if using custom pnpm configuration)
COPY package.json pnpm-lock.yaml* ./

# Install dependencies with pnpm
RUN pnpm install --production

# Clean up pnpm store to reduce image size
RUN pnpm store prune --production

# Set environment variable for Node.js environment
ENV NODE_ENV="production"

# Copy the entire project files into the working directory
COPY . .
CMD [ "npm", "start" ]

# Specify the command to run your application
CMD [ "pnpm", "start" ]

0 comments on commit c3a3728

Please sign in to comment.