ContentBox Docker new install + DigitalOcean MySQL

Hi Ortus Community,

We are having some difficulty with a fresh Docker install of ContentBox. We would like it to connect to a remote MySQL database that is running on DigitalOcean.

One thing to note, we can get the setup working properly when just running Docker for the EXPRESS H2 install. We can connect to the Docker container from outside on localhost:8080 and ContentBox is running. So that is good.

It is only when we try to import the specific Digital Ocean MySQL environment configuration variables that we get stuck. I can confirm that it looks like it can start a ColdBox server. I see that it creates two tables on the Digital Ocean database. I think this confirms that it can talk to the remote MySQL database from the docker container.

Also, we are passing the INSTALL=true in the .env and we are mounting that .env to the root of /app in the container (the mounting code is below in the docker-compose.yml and the .env file code).

Another thing, we were having some trouble with was some of the MySQL configuration variables. We had to modify the datasourceMixins.cfm to add check if DB_DRIVER is empty if( len( request.$coldboxUtil.getSystemSetting( "DB_DRIVER", "" ) ) ){ otherwise we get an error lucee.runtime.exp.CustomTypeException: Could not find a Java System property or Env setting with key [DB_DRIVER].. We are then mounting that as well and it looks like it does accept it.

So with all that we can get to [INFO ] 2022-09-05 19:25:18 contentbox.models.system.SettingService > Running ContentBox pre flight checks... but then Caused by: java.sql.SQLSyntaxErrorException: Table 'cfsolana_staging.cb_setting' doesn't exist

but we can see these tables were created, I think these are from ColdBox:

+----------------------------+
| Tables_in_cfsolana_staging |
+----------------------------+
| cachebox_content           |
| cachebox_sessions          |
+----------------------------+

So … from my understanding we can get most of the way there, but it seems that it cannot initialize ContentBox properly? What are we missing to get ContentBox up and running? Appreciate any help or guidance as we have been struggling with this for a while.

Thank you!!!

docker-compose.yml

version: "3.9"
services:

  # ContentBox Site
  contentbox_app:
    platform: linux/x86_64 # Needed for Mac's on the M1 chip
    image: ortussolutions/contentbox:latest-snapshot
    # Environment Variables
    environment: [] # these are passed in the .env file
    # Ports
    ports:
      - "8080:8080"
      - "8443:8443"
    # Data & Overrides
    volumes:
      - ./datasourceMixins.cfm:/app/config/datasourceMixins.cfm
      - .env:/app/.env
      - data:/app
volumes:
  data:

.env

# Install on first run 
INSTALL=true

APPNAME=EcoToken
ENVIRONMENT=production
CFCONFIG_ADMINPASSWORD=contentbox
COLDBOX_REINITPASSWORD=contentbox
COLDBOX_SESSION_TIMEOUT=60

######################################################
# Database Datasource Connection
######################################################
# DB_DRIVER=MySQL
DB_CLASS=com.mysql.cj.jdbc.Driver
# DB_BUNDLEVERSION=8.0.19
# DB_BUNDLENAME=com.mysql.cj
# DB Location
DB_CONNECTION_STRING=jdbc:mysql://<DO_HOST>:<DO_PORT>/<DO_DB>?allowPublicKeyRetrieval=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&useLegacyDatetimeCode=true
# DB Credentials
DB_USER=<DO_USER>
DB_PASSWORD=<DO_PASSWORD>