# docker-compose.dev.yml - Development configuration with Mailhog version: '3.8' services: # PostgreSQL Database db: image: postgres:15-alpine container_name: picpeak-postgres-dev environment: POSTGRES_DB: ${DB_NAME:-picpeak} POSTGRES_USER: ${DB_USER:-picpeak} POSTGRES_PASSWORD: ${DB_PASSWORD:-picpeak} volumes: - postgres_data_dev:/var/lib/postgresql/data ports: - "5432:5432" # Expose for local development tools restart: unless-stopped healthcheck: test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-picpeak}"] interval: 10s timeout: 5s retries: 5 # Backend API backend: build: ./backend container_name: picpeak-backend-dev depends_on: db: condition: service_healthy environment: NODE_ENV: development PORT: 3001 DATABASE_CLIENT: pg DB_HOST: db DB_PORT: 5432 DB_NAME: ${DB_NAME:-picpeak} DB_USER: ${DB_USER:-picpeak} DB_PASSWORD: ${DB_PASSWORD:-picpeak} JWT_SECRET: ${JWT_SECRET:-dev-secret-DO-NOT-USE-IN-PRODUCTION} ADMIN_URL: ${ADMIN_URL:-http://localhost:3005} FRONTEND_URL: ${FRONTEND_URL:-http://localhost:3005} BACKEND_URL: ${BACKEND_URL:-http://localhost:3001} # Email via Mailhog SMTP_HOST: mailhog SMTP_PORT: 1025 SMTP_SECURE: "false" SMTP_USER: "" SMTP_PASS: "" EMAIL_FROM: ${EMAIL_FROM:-noreply@localhost} volumes: - ./backend:/app - /app/node_modules # Prevent node_modules from being overwritten - ./storage:/app/storage - ./data:/app/data ports: - "3001:3001" restart: unless-stopped command: npm run dev healthcheck: test: ["CMD", "curl", "-f", "http://localhost:3001/api/health"] interval: 30s timeout: 10s retries: 3 # Frontend frontend: build: context: ./frontend dockerfile: Dockerfile.dev container_name: picpeak-frontend-dev depends_on: - backend environment: - VITE_API_URL=${VITE_API_URL:-http://localhost:3001/api} - VITE_UMAMI_URL=${VITE_UMAMI_URL} - VITE_UMAMI_WEBSITE_ID=${VITE_UMAMI_WEBSITE_ID} volumes: - ./frontend:/app - /app/node_modules # Prevent node_modules from being overwritten ports: - "3005:3005" restart: unless-stopped command: npm run dev -- --host 0.0.0.0 --port 3005 # Mailhog - Email testing for development mailhog: image: mailhog/mailhog:latest container_name: picpeak-mailhog ports: - "1025:1025" # SMTP server - "8025:8025" # Web UI restart: unless-stopped volumes: postgres_data_dev: networks: default: name: picpeak-dev-network