# docker-compose.prod.yml
# Production overrides for MotoVaultPro
#
# Usage:
#   docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d
#
# This file removes development-only configurations:
#   - Database port exposure (PostgreSQL, Redis)
#   - Development-specific settings

services:
  # Traefik - Production log level and dashboard auth
  mvp-traefik:
    environment:
      LOG_LEVEL: error
    command:
      - --configFile=/etc/traefik/traefik.yml
      - --log.level=ERROR
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.traefik-dashboard.rule=Host(`traefik.motovaultpro.local`)"
      - "traefik.http.routers.traefik-dashboard.tls=true"
      - "traefik.http.routers.traefik-dashboard.middlewares=dashboard-auth"
      - "traefik.http.services.traefik-dashboard.loadbalancer.server.port=8080"
      - "traefik.http.middlewares.dashboard-auth.basicauth.users=admin:$$2y$$10$$foobar"

  # Backend - Production log level
  mvp-backend:
    environment:
      NODE_ENV: production
      CONFIG_PATH: /app/config/production.yml
      SECRETS_DIR: /run/secrets
      LOG_LEVEL: error
      DATABASE_HOST: mvp-postgres
      REDIS_HOST: mvp-redis
      STRIPE_PRO_MONTHLY_PRICE_ID: prod_Toj6BG9Z9JwREl
      STRIPE_PRO_YEARLY_PRICE_ID: prod_Toj8oo0RpVBQmB
      STRIPE_ENTERPRISE_MONTHLY_PRICE_ID: prod_Toj8xGEui9jl6j
      STRIPE_ENTERPRISE_YEARLY_PRICE_ID: prod_Toj9A7A773xrdn

  # OCR - Production log level + engine config
  mvp-ocr:
    environment:
      LOG_LEVEL: error
      REDIS_HOST: mvp-redis
      REDIS_PORT: 6379
      REDIS_DB: 1
      OCR_PRIMARY_ENGINE: paddleocr
      OCR_FALLBACK_ENGINE: ${OCR_FALLBACK_ENGINE:-none}
      OCR_FALLBACK_THRESHOLD: ${OCR_FALLBACK_THRESHOLD:-0.6}
      GOOGLE_VISION_KEY_PATH: /run/secrets/google-vision-key.json

  # PostgreSQL - Remove dev ports, production log level
  mvp-postgres:
    ports: []
    environment:
      POSTGRES_DB: motovaultpro
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD_FILE: /run/secrets/postgres-password
      POSTGRES_INITDB_ARGS: --encoding=UTF8
      LOG_LEVEL: error
      POSTGRES_LOG_STATEMENT: none
      POSTGRES_LOG_MIN_DURATION_STATEMENT: -1
      PGDATA: /var/lib/postgresql/data

  # Redis - Remove dev ports, production log level
  mvp-redis:
    ports: []
    command: redis-server --appendonly yes --loglevel ${LOG_LEVEL:-info}
    environment:
      LOG_LEVEL: error
