version: "3"
services:
  application:
    build: .
    container_name: shopizer
    depends_on:
      - "database"
    links:
      - database
    environment:
      - JAVA_OPTS="-Xms4096m -Xmx6124m"
      - TRACER_ENABLE=true
      - TRACER_SERIALISE_INTERNALS=false
      - TRACER_VERBOSE=true
      - TRACER_TRACES=/caching-approaches-comparison/applications/traces/shopizer
      - TRACER_LOG=/caching-approaches-comparison/applications/output/shopizer-tracer.log
    volumes:
      - application:/application
      - /root/.m2:/root/.m2
      - ../../../:/caching-approaches-comparison
    restart: unless-stopped
    ports:
      - 8080:8080
    logging:
      options:
        max-size: "10m"
        max-file: "10"
  database:
    image: mysql:5.7.22
    expose:
      - 3306
    volumes:
      - ../../dumps/shopizer.sql:/docker-entrypoint-initdb.d/init.sql
      - database:/var/lib/mysql
    environment:
      MYSQL_USER: root
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: SALESMANAGER
    restart: unless-stopped
    logging:
      options:
        max-size: "10m"
        max-file: "10"
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:6.5.2
    expose:
      - 9200
      - 9300
    environment:
      discovery.type: single-node
    restart: unless-stopped
    logging:
      options:
        max-size: "10m"
        max-file: "10"
volumes:
  application:
  database: