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

services:
  certificate:
    build: ./module-certificate
    container_name: certificate
    image: xpokorn8/sprachschulsystem:certificate
    ports:
      - "5001:5001"

  exercise:
    build: ./module-exercise
    container_name: exercise
    image: xpokorn8/sprachschulsystem:exercise
    ports:
      - "5002:5002"

  language-school:
    build: ./module-language-school
    container_name: language-school
    image: xpokorn8/sprachschulsystem:language-school
    ports:
      - "5000:5000"

  mail:
    build: ./module-mail
    container_name: mail
    image: xpokorn8/sprachschulsystem:mail
    ports:
      - "5003:5003"

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

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



