version: '3.5'

services:
  #Mura Server
  mura_mysql_cfml:
    image: ortussolutions/commandbox:lucee5
    depends_on:
      - mura_mysql
    environment:
      PORT: 8080
      SSL_PORT: 8443
      URL_REWRITES: "true"
      HEAPSIZE: 1024
      CFENGINE: lucee@5
      CFCONFIG_ADMINPASSWORD: NOT_SECURE_CHANGE
      MURA_ADMIN_USERNAME: admin
      MURA_ADMIN_PASSWORD: admin
      MURA_ADMINEMAIL: example@localhost.com
      MURA_APPRELOADKEY: appreload
      MURA_DATASOURCE: muradb
      MURA_DATABASE: muradb
      MURA_DBTYPE: mysql
      MURA_DBCONNECTIONSTRING: "jdbc:mysql://mura_mysql:3306/muradb?useUnicode=true&characterEncoding=UTF-8&useLegacyDatetimeCode=true"
      MURA_DBCLASS: com.mysql.jdbc.Driver
      MURA_DBUSERNAME: root
      MURA_DBPASSWORD: FROM_ENV
      MURA_DBHOST: mura_mysql
      MURA_DBPORT: 3306
      MURA_SITEIDINURLS: "false"
      MURA_INDEXFILEINURLS: "false"
      MURA_TESTBOX: "true"
      MURA_PROJECT_SECRETS: projectsecrets
      MURA_GLOBAL_SECRETS: globalsecrets
    volumes:
      - ../../../:/app
    ports:
      - "8080:8080"
    secrets:
      - projectsecrets
      - globalsecrets

  #MySQL
  mura_mysql:
    image: mysql:5.7
    environment:
        MYSQL_ROOT_PASSWORD: NOT_SECURE_CHANGE
        MYSQL_DATABASE: muradb
    volumes:
        - mura_mysql_data:/var/lib/mysql
    ports:
        - "55556:3306"

volumes:
    mura_mysql_data:

secrets:
  projectsecrets:
    file: ./projectsecrets.json
  globalsecrets:
    file: ./globalsecrets.json
