version: '3.8'

services:
  postgres:
    image: postgres:18-alpine
    container_name: taxbaik-db
    environment:
      POSTGRES_DB: taxbaikdb
      POSTGRES_USER: taxbaik
      POSTGRES_PASSWORD: taxbaik123
    ports:
      - "5432:5432"
    volumes:
      - postgres_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U taxbaik -d taxbaikdb"]
      interval: 10s
      timeout: 5s
      retries: 5

  taxbaik-web:
    build:
      context: .
      dockerfile: Dockerfile.web
    container_name: taxbaik-web
    environment:
      ASPNETCORE_ENVIRONMENT: Development
      ASPNETCORE_URLS: http://0.0.0.0:5001
      ConnectionStrings__Default: "Host=postgres;Database=taxbaikdb;Username=taxbaik;Password=taxbaik123"
      Jwt__SecretKey: "dev-secret-key-change-in-production-min-32-chars!"
    ports:
      - "5001:5001"
    depends_on:
      postgres:
        condition: service_healthy
    volumes:
      - ./publish:/app

volumes:
  postgres_data:
