Fix issue #29: Migrate from npm to pnpm workspace
All checks were successful
Test / test (push) Successful in 2s
All checks were successful
Test / test (push) Successful in 2s
This commit is contained in:
@@ -1,21 +1,30 @@
|
||||
# Use official Node.js runtime
|
||||
FROM node:20-alpine
|
||||
|
||||
# pnpm is served by corepack and pinned by "packageManager" in the root package.json
|
||||
RUN corepack enable
|
||||
|
||||
# Create app directory
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Copy package files first (better caching)
|
||||
COPY package*.json ./
|
||||
# Copy the workspace manifests first (better caching)
|
||||
COPY pnpm-workspace.yaml pnpm-lock.yaml package.json ./
|
||||
COPY backend/package.json ./backend/
|
||||
COPY frontend/package.json ./frontend/
|
||||
COPY discord-bot/package.json ./discord-bot/
|
||||
|
||||
# Install dependencies
|
||||
RUN npm ci --only=production
|
||||
# Install the production dependencies of the bot package
|
||||
RUN pnpm install --frozen-lockfile --prod --filter ./discord-bot...
|
||||
|
||||
# Copy application source
|
||||
COPY . .
|
||||
COPY discord-bot ./discord-bot
|
||||
|
||||
# Environment variable
|
||||
ENV NODE_ENV=production
|
||||
|
||||
# The bot reads .env from its working directory
|
||||
WORKDIR /usr/src/app/discord-bot
|
||||
|
||||
# The bot only makes outbound connections (Discord gateway + Dragonroll API),
|
||||
# it does not listen on a port.
|
||||
# Start the application
|
||||
|
||||
Reference in New Issue
Block a user