services:
  # 1. ADATBÁZIS (A Raktár)
  postgres-db:
    image: postgres:15
    container_name: postgres-db
    environment:
      POSTGRES_USER: kincses
      POSTGRES_PASSWORD: MiskociA74
      POSTGRES_DB: service_finder
    volumes:
      - postgres_data:/var/lib/postgresql/data
    ports:
      - "5432:5432"
    networks:
      - service_finder_net

  # 2. BACKEND API (Az Agy)
  service_finder_api:
    build: 
      context: ./backend
      dockerfile: Dockerfile
    container_name: service_finder_api
    ports:
      - "8000:8000"
    volumes:
      - ./backend:/app/app
      - ./frontend:/app/frontend
    environment:
      - DATABASE_URL=postgresql+asyncpg://admin:MiskociA74@postgres-db:5432/service_finder
    depends_on:
      - postgres-db
    networks:
      - service_finder_net

  # 3. PGADMIN (A Monitor - Ezt hiányoltad!)
  pgadmin:
    image: dpage/pgadmin4
    container_name: pgadmin_ui
    environment:
      PGADMIN_DEFAULT_EMAIL: kincses@gmail.com
      PGADMIN_DEFAULT_PASSWORD: MiskociA74
    ports:
      - "5050:80"
    depends_on:
      - postgres-db
    networks:
      - service_finder_net

networks:
  service_finder_net:
    driver: bridge

volumes:
  postgres_data:
