strat-gameplay-webapp/frontend-sba/Dockerfile
Cal Corum 5c75b935f0 CLAUDE: Initial project setup - documentation and infrastructure
Add comprehensive project documentation and Docker infrastructure for
Paper Dynasty Real-Time Game Engine - a web-based multiplayer baseball
simulation platform replacing the legacy Google Sheets system.

Documentation Added:
- Complete PRD (Product Requirements Document)
- Project README with dual development workflows
- Implementation guide with 5-phase roadmap
- Architecture docs (backend, frontend, database, WebSocket)
- CLAUDE.md context files for each major directory

Infrastructure Added:
- Root docker-compose.yml for full stack orchestration
- Dockerfiles for backend and both frontends (multi-stage builds)
- .dockerignore files for optimal build context
- .env.example with all required configuration
- Updated .gitignore for Python, Node, Nuxt, and Docker

Project Structure:
- backend/ - FastAPI + Socket.io game engine (Python 3.11+)
- frontend-sba/ - SBA League Nuxt 3 frontend
- frontend-pd/ - PD League Nuxt 3 frontend
- .claude/implementation/ - Detailed implementation guides

Supports two development workflows:
1. Local dev (recommended): Services run natively with hot-reload
2. Full Docker: One-command stack orchestration for testing/demos

Next: Phase 1 implementation (backend/frontend foundations)
2025-10-21 16:21:13 -05:00

76 lines
1.4 KiB
Docker

# Frontend Dockerfile for SBA League
# Multi-stage build for optimized production image
FROM node:18-alpine as base
# Set working directory
WORKDIR /app
# Development stage
FROM base as development
# Copy package files
COPY package*.json ./
# Install all dependencies (including dev)
RUN npm ci
# Copy application code
COPY . .
# Expose port
EXPOSE 3000
# Set development environment
ENV NODE_ENV=development
# Run development server with hot-reload
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]
# Build stage
FROM base as builder
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci
# Copy application code
COPY . .
# Build application
RUN npm run build
# Production stage
FROM base as production
# Set production environment
ENV NODE_ENV=production
# Copy package files
COPY package*.json ./
# Install production dependencies only
RUN npm ci --omit=dev
# Copy built application from builder
COPY --from=builder /app/.output /app/.output
# Create non-root user
RUN addgroup -g 1001 -S nodejs && \
adduser -S nuxt -u 1001 && \
chown -R nuxt:nodejs /app
# Switch to non-root user
USER nuxt
# Expose port
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD node -e "require('http').get('http://localhost:3000', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"
# Run production server
CMD ["node", ".output/server/index.mjs"]