We use docker compose to organize MIRACLE's components. These consist of Docker images for the following:
- Container for a Django uWSGI application server and Celery running under supervisord. We are aware that Docker best practices call for one process per container, but in the interests of expediency and limited development resources we've bundled Django and celery together for the interim. If you'd like to help split them out, please send us a PR!
- One container for an nginx reverse proxy
- Container for a modified version of the Radiant business analytics Shiny app
- Container for DeployR that provides our R script execution environment
- Install the latest version of docker-compose and docker
- Create a local user named 'comses'. In order to handle file permissions on our shared volumes properly, make sure you create the user with a uid of 2000
- add yourself to the docker group
- Copy
development.yml
todocker-compose.yml
- Copy and edit the Django settings files
cp django/miracle/settings/local.py.example django/miracle/settings/local.py
- Running
docker-compose build && docker-compose up django
will start a Django development server on port 8000
- Copy
production.yml
todocker-compose.yml
and edit the relevant environment variables forMIRACLE_ADMIN
- Copy SSL certs and private key into the nginx directory as
server.crt
andserver.key
, respectively
- Copy
deploy/deployr/deployr.conf.example
todeploy/deployr/deployr.conf
and change the username / passwords so that the deployr container will create a custom user that can be accessed from Django. - set matching postgresql user password in
deploy/db/init-db-user.sh
anddjango/miracle/settings/local.py
- Build the images and start the containers via
% sh build.sh
- In the future, you can start everything up via
docker-compose up -d
and take them down viadocker-compose down
- The
miracle
homepage should be live athttps://localhost
at this point
You can load the luxedemo.packrat.tar.gz
and rhea.packrat.tar.gz
from the
miracle example projects github repository via the command line by
downloading the packrat.tar.gz
files into the django
directory (this project's source tree is mapped to
/code/ in the Django container by default) and performing the following steps:
% docker-compose exec django bash # login to the container
% cd django;
% ./manage.py load_project luxedemo.packrat.tar.gz --creator=<username> --project=luxedemo
% ./manage.py load_project rhea.packrat.tar.gz --creator=<username> --project=rhea