# Docker Compose для локальной разработки и тестирования
version: '3.8'

services:
  python-navigator-demo-postgres:
    image: postgres:15-alpine
    environment:
      POSTGRES_DB: dexdemo
      POSTGRES_USER: dexdemo
      POSTGRES_PASSWORD: dexdemo
    ports:
      - "5440:5432"
    volumes:
      - python-navigator-demo-postgres_data:/var/lib/postgresql/data
      - ./db/init.sql:/docker-entrypoint-initdb.d/init.sql
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U dexdemo"]
      interval: 10s
      timeout: 5s
      retries: 5

  python-navigator-demo-backend:
    build: ./backend
    ports:
      - "8000:8000"
    environment:
      DB_HOST: postgres
      DB_PORT: 5432
      DB_NAME: dexdemo
      DB_USER: dexdemo
      DB_PASSWORD: dexdemo
      DEX_ISSUER: https://dex.127.0.0.1.sslip.io
      # Режим разработки - установите INSECURE_DEV_MODE=true для локальной разработки без OIDC
      INSECURE_DEV_MODE: "true"
      INSECURE_DEV_EMAIL: "developer@example.com"
    depends_on:
      python-navigator-demo-postgres:
        condition: service_healthy

  python-navigator-demo-frontend:
    build: ./frontend
    ports:
      - "8080:80"

volumes:
  python-navigator-demo-postgres_data:

