Introduction

The reference compose stack is for districts which self-host SMS. This allows you to use Docker Compose to programmatically spin up and maintain all the components of SMS on a single server.

You may choose to iterate on this reference implementation depending on your needs. However, this file will change over time with incremental releases of SMS so we recommend you subscribe to the WCLN Discussion Forms for SMS release notes, as well as check back here periodically.

Reference Compose File

web:
  image: bcln/sms
  restart: always
  links:
    - db
    - es
    - redis
    - rabbitmq
  volumes:
    - ./records:/records
  environment:
    - LMS_PROVIDER=brightspace
    - DB=rethink://db:28015/sms
    - REDIS_URL=redis://redis:6379
    - ELASTICSEARCH=es://es:9200/sms
    - RABBITMQ=amqp://rabbitmq:5672/sms
    - RECORDSCSV=/records/StudentDemographicInformation.txt
    - SESSION_SECRET={{RANDOM 25 CHARACTER ALPHANUMERIC}}
    - LMS={{LMS URL}}
    - CLIENT_ID={{OAUTH ID}}
    - CLIENT_SECRET={{OAUTH SECRET}
    - ACTIVATION_STUDENT_ID={{ROLE ID}}
    - STUDENT_ID={{ROLE ID}}
    - INSTRUCTOR_ID={{ROLE ID}}
    - FROMEMAIL={{SUPPORT EMAIL}}
		- REPLYEMAIL={{SUPPORT EMAIL}}
    - VIRTUAL_HOST={{SMS HOSTNAME}}
    - HOST=https://{{SMS HOSTNAME}}
    - SMTP={{SMTP INFO}}
    - ISMYEDBC=true

proxy:
  image: jwilder/nginx-proxy:alpine
  restart: always
  volumes:
    - /var/run/docker.sock:/tmp/docker.sock
    - ./certs:/etc/nginx/certs:ro
  ports:
    - "80:80"
    - "443:443"

db:
  image: rethinkdb:2.4.2
  restart: always
  volumes:
    - /data/db:/data

es:
  image: elasticsearch:8.3.1
  restart: always
  volumes:
    - /data/es:/usr/share/elasticsearch/data
  environment:
    - ES_JAVA_OPTS=-Xms512m -Xmx512m
    - xpack.security.enabled=false
    - discovery.type=single-node

rabbitmq:
  image: rabbitmq:3
  restart: always
  volumes:
    - /data/rabbitmq:/var/lib/rabbitmq

redis:
  image: redis:7.0
  restart: always

Notes and Customizations

This above example assumes you have a directory (./certs/) in your workspace that contains your SSL certificates, as it is highly recommended that use SSL with SMS for privacy of student information and user security. Name the files the same as your hostname, so for example if your hostname was "test.bc.ca" then your certificates would be named like "test.bc.ca.crt".

We're also assuming that you are a MyEdBC installation in the above example. If you're not, you can leave out the RECORDSCSV environment variable and the volumes section of the config. If you are a MyEdBC installation, we are assuming that your MyEdBC output CSV is stored in ./records/StudentDemographicInformation.txt relative to your docker compose directory. If the directory ./records/ does not exist, it will be created (with root ownership) when the container starts. You can read more about volumes on the Docker userguide.

Finally, the above example also assumes that you have a directory at the root of your filesystem (/data/) that you want to contain your Elasticsearch and RethinkDB database files. These are exposed for backup and persistence purposes.