version: "3.8"
services:
  vanilla-init:
    container_name: vanilla-init
    image: bpmconseil/vanilla-init:latest
    command: /copy_database_backup.sh
    volumes:
      - database_init:/docker-entrypoint-initdb.d

  vanilla-mysql:
    container_name: vanilla-mysql
    image: mysql:5.7.36
    depends_on:
      - vanilla-init
    volumes:
      - database_init:/docker-entrypoint-initdb.d
      - ./dbdata:/var/lib/mysql
    env_file:
      - .env.vanilla
    ports:
      - 3306:3306
    healthcheck:
      test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
      timeout: 5s
      retries: 20
    command: mysqld --lower_case_table_names=1 --skip-ssl --character_set_server=utf8mb4 --explicit_defaults_for_timestamp --sql-mode="ansi"
    restart: unless-stopped
  vanilla-runtime:
    container_name: vanilla-runtime
    image: bpmconseil/vanilla-runtime:latest
    depends_on:
      vanilla-mysql:
        condition: service_healthy
    environment:
        JAVA_OPTIONS: "-Xms256m -Xmx1024m -Dosgi.compatibility.bootdelegation=true -Declipse.ignoreApp=true -Dosgi.noShutdown=true -Dlog4j.debug=true -Dorg.eclipse.equinox.http.jetty.http.port=7171 -Dorg.eclipse.equinox.http.jetty.context.path=/VanillaRuntime -Dbpm.vanilla.configurationFile=/usr/local/vanilla/vanilla/vanilla-conf/vanilla.properties -Dlogback.configurationFile=/usr/local/vanilla/vanilla/vanilla-conf/logback.xml"
    env_file:
      - .env.vanilla
    volumes:
      - vanillafiles:/usr/local/vanilla/webapps/vanilla_files
      - vanillaconf:/usr/local/vanilla/vanilla/vanilla-conf
    ports:
      - 7171:7171
      - 9015:9015
      - 6311:6311
    # If there is a reverse, you need to add the following line
    extra_hosts:
      - "vanilla-runtime:127.0.0.1"
    restart: unless-stopped
  vanilla-webapps:
    container_name: vanilla-webapps
    image: bpmconseil/vanilla-webapps:latest
    depends_on:
      vanilla-mysql:
        condition: service_healthy
    volumes:
      - vanillafiles:/var/lib/jetty/webapps/vanilla_files
      - vanillaconf:/var/lib/jetty/vanilla/vanilla-conf
    environment:
        JAVA_OPTIONS: "-Xms256m -Xmx4096m -Dlog4j.debug=true -Dbpm.vanilla.configurationFile=/var/lib/jetty/vanilla/vanilla-conf/vanilla.properties -Dlogback.configurationFile=/var/lib/jetty/vanilla/vanilla-conf/logback.xml"
    env_file:
      - .env.vanilla
    ports:
      - 8080:8080
    restart: unless-stopped
  # vanilla-air:
  #   container_name: vanilla-air
  #   image: bpmconseil/rserve
  #   ports:
  #     - 6311:6311
  # vanilla-solr:
  #   image: solr:8
  #   image: solr:5.5.0
  #   volumes:
  #     - solrdata:/var/solr
  #   command:
  #     - solr-precreate
  #     - gettingstarted
  #   networks:
  #     - proxynet
  #   ports:
  #     - 8983:8983
  # vanilla-r:
  #   image: r-base:4.1.2
  #   args:
  #     - "--no-save"
  #   networks:
  #     - proxynet
  #   ports:
  #     - 19191:19191
  vanilla-gotenberg:
    container_name: vanilla-gotenberg
    image: gotenberg/gotenberg:8
    ports:
      - 3000:3000
    restart: unless-stopped
      
volumes:
  database_init:
  dbdata:
  vanillafiles:
  vanillaconf:
  solrdata:
    
networks:
  default:
    name: ckan-local-network
    driver: bridge