Frontend UX improvements: - Single-click Discord OAuth from home page (no intermediate /auth page) - Auto-redirect authenticated users from home to /games - Fixed Nuxt layout system - app.vue now wraps NuxtPage with NuxtLayout - Games page now has proper card container with shadow/border styling - Layout header includes working logout with API cookie clearing Games list enhancements: - Display team names (lname) instead of just team IDs - Show current score for each team - Show inning indicator (Top/Bot X) for active games - Responsive header with wrapped buttons on mobile Backend improvements: - Added team caching to SbaApiClient (1-hour TTL) - Enhanced GameListItem with team names, scores, inning data - Games endpoint now enriches response with SBA API team data Docker optimizations: - Optimized Dockerfile using --chown flag on COPY (faster than chown -R) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
76 lines
1.4 KiB
Docker
76 lines
1.4 KiB
Docker
# Frontend Dockerfile for PD League
|
|
# Multi-stage build for optimized production image
|
|
|
|
FROM node:22-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"] |