Files
company-celebration/packages/server/Dockerfile
empty d4289825aa feat: add Docker deployment configuration
- Add server Dockerfile with multi-stage build
- Add frontend Dockerfile with Nginx
- Add docker-compose.yml for orchestration
- Add Nginx config with SSL support
- Add deployment documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 00:23:25 +08:00

44 lines
942 B
Docker

FROM node:20-alpine AS builder
WORKDIR /app
# Install pnpm
RUN npm install -g pnpm
# Copy workspace files
COPY pnpm-workspace.yaml package.json pnpm-lock.yaml ./
COPY packages/shared ./packages/shared
COPY packages/server ./packages/server
# Install dependencies
RUN pnpm install --frozen-lockfile
# Build shared package first
WORKDIR /app/packages/shared
RUN pnpm build
# Build server
WORKDIR /app/packages/server
RUN pnpm build
# Production stage
FROM node:20-alpine AS production
WORKDIR /app
RUN npm install -g pnpm
# Copy built files
COPY --from=builder /app/packages/server/dist ./dist
COPY --from=builder /app/packages/server/package.json ./
COPY --from=builder /app/packages/shared /app/packages/shared
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/packages/server/node_modules ./packages/server/node_modules
ENV NODE_ENV=production
ENV PORT=3000
EXPOSE 3000
CMD ["node", "dist/index.js"]