version: '3'
volumes:
  prometheus_data:
  grafana-data:

services:
  certificate:
    build: ./module-certificate
    container_name: certificate
    image: xpokorn8/sprachschulsystem:certificate
    ports:
      - "8082:8082"
    environment:
      - DOCKER_RUNNING=true

  exercise:
    build: ./module-exercise
    container_name: exercise
    image: xpokorn8/sprachschulsystem:exercise
    ports:
      - "8083:8083"
    environment:
      - DOCKER_RUNNING=true

  language-school:
    build: ./module-language-school
    container_name: language-school
    image: xpokorn8/sprachschulsystem:language-school
    ports:
      - "8081:8081"
    environment:
      - DOCKER_RUNNING=true

  mail:
    build: ./module-mail
    container_name: mail
    image: xpokorn8/sprachschulsystem:mail
    ports:
      - "8084:8084"
    environment:
      - DOCKER_RUNNING=true
      
  confidential-client:
    build: ./confidentialClient
    container_name: confidential-client
    image: xpokorn8/sprachschulsystem:confidential-client
    environment:
      - DOCKER_RUNNING=true
    ports:
      - "8080:8080"

  prometheus:
    image: prom/prometheus:v2.43.0
    container_name: prometheus
    volumes:
      - ./prometheus:/etc/prometheus
      - prometheus_data:/prometheus
    environment:
      - DOCKER_RUNNING=true
    expose:
      - 9090
    ports:
      - "9090:9090"
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'

  grafana:
      image: grafana/grafana:7.5.7
      ports:
        - "3000:3000"
      environment:
        - DOCKER_RUNNING=true
      restart: unless-stopped
      volumes:
        - ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
        - grafana-data:/var/lib/grafana



