Files
dragonroll/backend/Dockerfile
Gitea OpenCode Agent 9820a375dc
All checks were successful
Test / test (push) Successful in 2s
Fix issue #29: Migrate from npm to pnpm workspace
2026-10-14 17:01:02 +00:00

30 lines
801 B
Docker

# 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 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 the production dependencies of the backend package
RUN pnpm install --frozen-lockfile --prod --filter ./backend...
# Copy application source
COPY backend ./backend
# Environment variable
ENV NODE_ENV=production
# The app reads .env.production from its working directory
WORKDIR /usr/src/app/backend
# Start the application
CMD ["node", "src/index.js"]