services:
  backend:
    build: .
    container_name: dt_backend
    ports:
      - "8001:8000"
    volumes:
      - ../data:/data
    env_file:
      - .env
    environment:
      - NEO4J_URI=bolt://neo4j:7687
      - NEO4J_USER=neo4j
      - NEO4J_PASSWORD=dtmap2024
    depends_on:
      neo4j:
        condition: service_healthy

  neo4j:
    image: neo4j:5-community
    container_name: dt_neo4j
    ports:
      - "7474:7474"
      - "7687:7687"
    environment:
      NEO4J_AUTH: neo4j/dtmap2024
      NEO4J_server_memory_heap_initial__size: 512m
      NEO4J_server_memory_heap_max__size: 1G
    volumes:
      - neo4j_data:/data
      - neo4j_logs:/logs
    healthcheck:
      test: ["CMD", "neo4j", "status"]
      interval: 10s
      timeout: 5s
      retries: 10

volumes:
  neo4j_data:
  neo4j_logs:
