version: '3'

services:
  # Nginx as an API Gateway
#  api_gateway:
#    # Container name
#    container_name: api_gateway
#    #
#    image: api-gateway:latest
#    #
#    build:
#      context: .
#      dockerfile: docker/nginx/Dockerfile
#    # Volume for the nginx Docker container
#    volumes:
#      - ./docker/nginx/conf.d/:/etc/nginx/conf.d/
#    # ports for the Nginx application service
#    ports:
#      - "80:80"
#    # The Nginx service depends on the Flask application services
#    depends_on:
#      - auth-service
#    # Network configuration
#    networks:
#     - pige_network

  # Authentication Service
  # auth-service:
  #   container_name: auth-service
  #   image: auth-service:latest
  #   build:
  #     context: ./auth-service
  #     dockerfile: docker/Dockerfile
  #   ports:
  #     - "8001:8000"
  #   environment:
  #     - FLASK_DEBUG=development
  #     - MONGODB_URI=mongodb://mongo:27017/authdb
  #   volumes:
  #     - ./auth-service/:/app
  #   depends_on:
  #     - mongo-database
  #   networks:
  #     - pige_network
 
  # Account Management Service
  # account-service:
  #   container_name: account-service
  #   image: account-service:latest
  #   build:
  #     context: ./account-service
  #     dockerfile: docker/Dockerfile
  #   ports:
  #     - "8002:8000"
  #   environment:
  #     - FLASK_DEBUG=development
  #     - MONGODB_URI=mongodb://mongo:27017/authdb
  #   volumes:
  #     - ./account-service/:/app
  #   depends_on:
  #     - mongo-database
  #   networks:
  #     - pige_network

  # Data Management Service
  data-service:
    container_name: data-service
    image: data-service:latest
    build:
      context: ./data-service
      dockerfile: docker/Dockerfile
      target: development
    ports:
      - "8003:8000"
    environment:
      - FLASK_DEBUG=1
      - MONGODB_URI=mongodb://mongo:27017/authdb
    volumes:
      - ./data-service/:/app
    depends_on:
      - mongo-database
    networks:
      - pige_network
 
  # MongoDB Service
  mongo-database:
    container_name: mongo-database
    image: mongo:latest                  
    ports:
      - "27018:27017"             
    environment:
      - MONGO_INITDB_DATABASE=database    
    networks:
      - pige_network                  

  # MongoDB Viewer (AdminMongo)
  mongo-viewer:
    container_name: mongo-database-viewer
    image: mongo-express:latest        
    ports:
      - "8081:8081"              
    environment:
      ME_CONFIG_MONGODB_SERVER: "mongo-database"
      ME_CONFIG_BASICAUTH_USERNAME: "admin"
      ME_CONFIG_BASICAUTH_PASSWORD: "admin" 
    networks:
      - pige_network                   

#  rabbitmq-server:
#    container_name: rabbitmq-server
#    image: rabbitmq:latest
#    ports:
#      - 5672:5672
#      - 15672:15672
#    networks:
#      - pige_network

# Define networks for better isolation
networks:
  pige_network:
    driver: bridge              

 