The Server is a stateless Docker image that can be deployed on any infrastructure that supports Docker.

You can scale it horizontally by deploying multiple instances of the server. However it’s important to activate an auto-scaler to handle the traffic spikes.

If your Rimdian Servers can’t keep up with the work, the Task Queue will slow down the processing rate and the buffer will grow.

Deployment

The Docker image is available on Docker Hub and can be pulled with the following command:

docker pull rimdian/server:latest

Env variables

All the following environment variables are required to run the data Collector.

PropertyDescriptionExample
ENVThe environment the server is running in.development or test or production
API_PORTThe port the server will listen to.8080
API_ENDPOINTThe hostname of the exposed API server.rimdian.mybusiness.com
COLLECTOR_ENDPOINTThe hostname of the exposed data Collector server.go.mybusiness.com
SECRET_KEY The secret key for signing data, tokens etc… Should be same as the Collector configuration.my-very-complex-secret-key
CUBEJS_API_SECRET The Cube.js API secret key for signing tokens Should be same as the Cube.js CUBEJS_API_SECRET.my-very-complex-secret-key
ORGANIZATION_IDThe default organization ID created on install. It cannot be changed later.mybusiness
ORGANIZATION_NAMEThe default organization name created on install.My Business
ROOT_EMAILThe root account email.admin@mybusiness.com
DB_DSNThe database connection string.user:pass@tcp(IP:3306)/?tls=skip-verify
SMTP_HOSTThe SMTP host for system emails.smtp.mybusiness.com
SMTP_PORTThe SMTP port for system emails.587
SMTP_USERNAMEThe SMTP username for system emails.username
SMTP_PASSWORDThe SMTP password for system emails.password
SMTP_FROMThe SMTP from email for system emails.admin@mybusiness.com
SMTP_ENCRYPTIONThe SMTP encryption for system emails.STARTTLS or SSLTLS
GCLOUD_PROJECTThe Google Cloud workspace ID.mybusiness
GCLOUD_JSON_CREDENTIALSThe Google Cloud JSON credentials.{"type":"service_account","project_id":"mybusiness" ...}
TASK_QUEUE_LOCATIONThe Task Queue location for tasks.europe-west1
CUBEJS_ENDPOINTThe Cube.js endpoint.http://cubejs.mybusiness.com

Optional env variables:

PropertyDescriptionExample
OPEN_CENSUS_EXPORTERThe OpenCensus exporter for stats & tracing.stackdriver
SENTRY_DSNThe Sentry DSN.https://XXXXXXXX...
DB_PREFIXThe Rimdian database prefix.rmd_
DB_MAX_OPEN_CONNSThe maximum number of open connections to the database.200
DB_MAX_IDLE_CONNSThe maximum number of idle connections to the database.200
DB_MAINTENANCESet to true if the database is under maintenance and not accessible.false
DB_CA_CERT_BASE64The database TLS Certificate Authority.XXXXXXXX...

S3 Storage with Google Cloud Storage

Rimdian uses S3 storage for file uploads (images, videos, etc…).

If you want to use S3 storage with Google Cloud Storage, you should activate the S3 compatibility mode on GCS and set the CORS policy like this:

gcs_cors.json
[
    {
      "origin": ["*"],
      "responseHeader": ["*"],
      "method": ["GET", "HEAD", "PUT", "POST", "DELETE"],
      "maxAgeSeconds": 3600
    }
]
gcloud storage buckets update gs://BUCKET_NAME --cors-file=gcs_cors.json
gcloud storage buckets describe gs://BUCKET_NAME --format="default(cors_config)"