version: "2"

services:

  ui:
    build: ./ui
    networks:
      - cloudcms
    depends_on:
      - api
    env_file:
      - ./ui/ui.env
    ports:
      - "80:80"

  api:
    build: ./api
    networks:
      - cloudcms
    depends_on:
      - mongodb
      - elasticsearch
    env_file:
      - ./api/api.env
    ports:
      - "8080:8080"

  mongodb:
    build: ./mongodb
    networks:
      - cloudcms
    ports:
      - "27017:27017"
    command: mongod --config /etc/mongod.conf

  elasticsearch:
    build: ./elasticsearch
    networks:
      - cloudcms
    ports:
      - "9300:9300"
    command: elasticsearch -Des.cluster.name=cloudcms-docker

networks:
  cloudcms:
    driver: bridge