version: "3.7"
services:
  dbmysql:
    image: mysql:8.0
    container_name: 'dbmysql'
    environment:
      MYSQL_DATABASE: 'gruppen2'
      MYSQL_USER: 'root'
      MYSQL_ROOT_PASSWORD: 'geheim'
    restart: always
    volumes:
      - './mysql/db/storage:/var/lib/mysql'
      - './mysql/db/entrypoint:/docker-entrypoint-initdb.d/'
    ports:
      - '3306:3306'
  gruppenapp:
    build: .
    container_name: 'gruppenapp'
    depends_on:
      - dbmysql
    command: ["/app/wait-for-it.sh", "dbmysql:3306", "--", "java", "-Dspring.profiles.active=docker", "-jar", "/app/gruppen2.jar"]
    ports:
      - '8081:8080'
