# Copyright by Intland Software, https://www.intland.com
#
# All rights reserved.
#
# Please note that if you change this docker file, we do not take any responsibility and we are not liable for
# any damage caused through use of this image, be it indirect, special, incidental
# or consequential damages (including but not limited to damages for loss of business, loss of profits, interruption or the like).


version: '2.1'


services:
  retina-db:
    image: intland/mysql:5.7.24
    environment:
      - MYSQL_USER=user
      - MYSQL_PASSWORD=pass
      - MYSQL_DATABASE=retina
      - MYSQL_MAX_ALLOWED_PACKET=1024M
      - MYSQL_INNODB_BUFFER_POOL_SIZE=1G
      - MYSQL_INNODB_LOG_FILE_SIZE=256M
      - MYSQL_INNODB_LOG_BUFFER_SIZE=256M
    volumes:
      - retina-db-data:/var/lib/mysql/data


  retina-app:
    image: intland/retina:1.2
    ports:
      - 8080:8080
    environment:
      - WAIT_HOSTS=container-mysql:3306
      - WAIT_HOSTS_TIMEOUT=120
      - CB_REDIRECT_TO=/retina
      - CB_CONTEXT_PATH=cb
      - CB_database_JDBC_Username=user
      - CB_database_JDBC_Password=pass
      - CB_database_JDBC_Driver=com.mysql.jdbc.Driver
      - CB_database_JDBC_ConnectionURL=jdbc:mysql://container-mysql:3306/retina?autoReconnect=true&zeroDateTimeBehavior=convertToNull&emulateLocators=true&characterEncoding=UTF-8&useSSL=false
    volumes:
      - retina-app-repository-docs:/home/appuser/codebeamer/repository/docs
      - retina-app-repository-search:/home/appuser/codebeamer/repository/search
      - retina-app-logs:/home/appuser/codebeamer/logs
    links:
      - retina-db:container-mysql


volumes:
  retina-db-data:
  retina-app-repository-docs:
  retina-app-repository-search:
  retina-app-logs: