services:
  web:
    build:
      context: ./  
      dockerfile: ./Dockerfile
      env_file : ./.env
    ports:
      - "8082:80"  # Exposing the web application on port 8082
      - "443:443"  # Exposing the web application on port 8082
    volumes:
       # - "/home/tadaang1/public_html:/var/www/html"
        - "/Applications/MAMP/htdocs/Fourth_Union/Development/Manorama:/var/www/html/"  # Mapping host path to container path
    depends_on:
      - redis
    networks:
      - ci3-network  # Connecting to the defined network
    container_name: manorama-web-container
    networks:
      - ci3-network

  phpmyadmin:
    image: manorama-docker
    ports:
      - "8083:80"  # Exposing phpMyAdmin on port 8083
    restart: on-failure
    environment:
      PMA_HOST: DB_HOST  # External MySQL server's IP address
      PMA_PORT: DB_PORT  # MySQL port on the external server
      PMA_USER: DB_USER  # MySQL user
      PMA_PASSWORD: DB_PASS  # MySQL password (no escape needed)
    networks:
      - ci3-network  # Connecting to the defined network

networks:
  ci3-network:
    driver: bridge  # Creating a bridge network for inter-container communication

volumes:
  db_data:  # Named volume for MySQL data persistence

