version: '3.5'
services:
  gitsearch-app:
    image: docker.uibk.ac.at:443/csar9407/gitsearch:clickable-search-info-14052f10d9a7662598e87bae3e51c2cc48b2e7ae
    container_name: sharing_search
    environment:
      - _JAVA_OPTIONS=-Xmx512m -Xms256m
      - SPRING_PROFILES_ACTIVE=prod,swagger
      - MANAGEMENT_METRICS_EXPORT_PROMETHEUS_ENABLED=true
      - SPRING_DATASOURCE_URL=jdbc:mysql://sharing_mysql:3306/gitsearch?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true
      - JHIPSTER_SLEEP=30 # gives time for other services to boot before the application
      - SPRING_DATA_JEST_URI=http://sharing_elasticsearch:9200
      - SPRING_ELASTICSEARCH_REST_URIS=http://sharing_elasticsearch:9200
    ports:
      - 10084:8080
    networks:
      - backend
      - frontend
  sharing_mysql:
    image: mysql:8.0.20
    container_name: sharing_mysql
    volumes:
      - '$MYSQL_HOME:/var/lib/mysql/'
    environment:
      - MYSQL_USER=root
      - MYSQL_ALLOW_EMPTY_PASSWORD=yes
      - MYSQL_DATABASE=gitsearch
    command: mysqld --lower_case_table_names=1 --skip-ssl --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
    networks:
      - backend
networks:
  frontend:
    name: sharing_frontend
    driver: bridge
  backend:
    name: sharing_backend
    driver: bridge
    internal: true
