Add comprehensive development setup for frontend debugging and rapid iteration. FEATURES: ✓ Hot Module Reload (HMR) - auto-refresh on file changes ✓ Detailed Logging - all console logs visible in Docker output ✓ TypeScript Checking - real-time type validation ✓ Source Maps - easier debugging in DevTools ✓ Fast Iteration - no container rebuild needed for code changes FILES ADDED: - docker-compose.dev.yml - compose override with dev-specific settings - docker/Dockerfile.frontend.dev - updated with dev environment variables - dev-mode.sh - helper script with easy commands - DEV_MODE.md - comprehensive development guide - QUICK_DEV_START.md - quick start instructions USAGE: ./dev-mode.sh start # Start frontend in dev mode ./dev-mode.sh logs # Stream frontend logs ./dev-mode.sh logs-all # Stream all services logs ./dev-mode.sh stop # Stop development mode ./dev-mode.sh rebuild # Rebuild after package.json changes ./dev-mode.sh shell # Open shell in container ./dev-mode.sh status # Check container status BENEFITS: - Faster feedback loop during development - Better debugging with detailed logs - No production artifacts in dev container - Source code mounted for real-time updates - Improved developer experience 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
45 lines
1.1 KiB
YAML
45 lines
1.1 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# Development version of the frontend with hot reload and verbose logging
|
|
frontend-dev:
|
|
build:
|
|
context: .
|
|
dockerfile: docker/Dockerfile.frontend.dev
|
|
container_name: evoting_frontend_dev
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${FRONTEND_PORT:-3000}:3000"
|
|
depends_on:
|
|
backend:
|
|
condition: service_healthy
|
|
validator-1:
|
|
condition: service_healthy
|
|
validator-2:
|
|
condition: service_healthy
|
|
validator-3:
|
|
condition: service_healthy
|
|
environment:
|
|
NEXT_PUBLIC_API_URL: http://localhost:${BACKEND_PORT:-8000}
|
|
NODE_ENV: development
|
|
NEXT_PUBLIC_DEBUG: 'true'
|
|
NODE_OPTIONS: "--max_old_space_size=4096"
|
|
volumes:
|
|
# Mount source code for hot reload
|
|
- ./frontend:/app
|
|
- /app/node_modules
|
|
- /app/.next
|
|
networks:
|
|
- evoting_network
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "50m"
|
|
max-file: "5"
|
|
# Run in development mode with verbose output
|
|
command: npm run dev -- -H 0.0.0.0 --port 3000
|
|
|
|
networks:
|
|
evoting_network:
|
|
driver: bridge
|