# Dockerfile.dev # ============================================================================ # DEVELOPMENT DOCKERFILE # ============================================================================ # This Dockerfile creates a development environment that matches production # as closely as possible while providing the tools needed for development. # # Base: Ubuntu 22.04 (LTS) - matches production server # Node: v20.x (LTS) - matches production # Includes: PostgreSQL client, Redis CLI, build tools # ============================================================================ FROM ubuntu:22.04 # Set environment variables to non-interactive to avoid prompts during installation ENV DEBIAN_FRONTEND=noninteractive # ============================================================================ # Install System Dependencies # ============================================================================ # - curl: for downloading Node.js setup script and health checks # - git: for version control operations # - build-essential: for compiling native Node.js modules (node-gyp) # - python3: required by some Node.js build tools # - postgresql-client: for psql CLI (database initialization) # - redis-tools: for redis-cli (health checks) RUN apt-get update && apt-get install -y \ curl \ git \ build-essential \ python3 \ postgresql-client \ redis-tools \ && rm -rf /var/lib/apt/lists/* # ============================================================================ # Install Node.js 20.x (LTS) # ============================================================================ RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ && apt-get install -y nodejs # ============================================================================ # Set Working Directory # ============================================================================ WORKDIR /app # ============================================================================ # Environment Configuration # ============================================================================ # Default environment variables for development ENV NODE_ENV=development # Increase Node.js memory limit for large builds ENV NODE_OPTIONS='--max-old-space-size=8192' # ============================================================================ # Default Command # ============================================================================ # Keep container running so VS Code can attach. # Actual commands (npm run dev, etc.) are run via devcontainer.json. CMD ["bash"]