## Changes ### Database Integration - Add MySQL 8.0 service to docker-compose.yml - Configure DATABASE_URL environment variable for server - Add health check for MySQL service - Create mysql_data volume for data persistence ### Dockerfile Improvements - Generate Prisma Client in builder stage - Copy Prisma Client from correct pnpm workspace location - Ensure Prisma Client is available in production container ### Client-Mobile Fixes - Remove deprecated StampDock.vue component - Fix voting store API usage in VotingPage.vue - Add type assertion for userTickets in connection.ts - Add remark property to AwardConfig interface in voting.ts ## Testing - All containers start successfully - Database connection established - Redis connection working - 94 participants restored from Redis - Vote data synced (20 votes) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
65 lines
1.7 KiB
Docker
65 lines
1.7 KiB
Docker
FROM node:20-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Install pnpm and configure registry
|
|
RUN npm config set registry https://registry.npmmirror.com && \
|
|
npm install -g pnpm && \
|
|
pnpm config set registry https://registry.npmmirror.com
|
|
|
|
# Copy workspace files
|
|
COPY pnpm-workspace.yaml package.json pnpm-lock.yaml tsconfig.base.json ./
|
|
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
|
|
|
|
# Generate Prisma Client in builder stage
|
|
RUN npx prisma generate
|
|
|
|
# Production stage
|
|
FROM node:20-alpine AS production
|
|
|
|
WORKDIR /app
|
|
|
|
RUN npm config set registry https://registry.npmmirror.com && \
|
|
npm install -g pnpm && \
|
|
pnpm config set registry https://registry.npmmirror.com
|
|
|
|
# Copy package files
|
|
COPY --from=builder /app/pnpm-workspace.yaml ./
|
|
COPY --from=builder /app/package.json ./
|
|
COPY --from=builder /app/pnpm-lock.yaml ./
|
|
COPY --from=builder /app/packages/server/package.json ./packages/server/
|
|
COPY --from=builder /app/packages/shared ./packages/shared
|
|
|
|
# Copy Prisma schema
|
|
COPY --from=builder /app/packages/server/prisma ./packages/server/prisma
|
|
|
|
# Install production dependencies only
|
|
RUN pnpm install --prod --frozen-lockfile
|
|
|
|
# Copy generated Prisma Client from builder stage (pnpm workspace location)
|
|
COPY --from=builder /app/node_modules/.pnpm ./node_modules/.pnpm
|
|
|
|
# Copy built files
|
|
COPY --from=builder /app/packages/server/dist ./packages/server/dist
|
|
COPY --from=builder /app/packages/server/src/lua ./packages/server/lua
|
|
|
|
ENV NODE_ENV=production
|
|
ENV PORT=3000
|
|
|
|
EXPOSE 3000
|
|
|
|
WORKDIR /app/packages/server
|
|
CMD ["node", "dist/index.js"]
|