Yet another try to containerize REDCap but with a focus on automated deployments.
Status: 🚧 This project is "work in progress" but we have a running alpha beta. I would appriciate your feedback
Maintainer: Tim Bleimehl, DZD
Docker image: https://hub.docker.com/r/dzdde/redcap-docker
Source: https://github.com/DZD-eV-Diabetes-Research/redcap-docker
- redcap-docker
- Disclaimer
- About / Motivation
- Features
- Roadmap
- Ideas
- Minimal example docker compose
- Container image details
This is not an official REDCap project.
We are only a institutional partner of the REDCap Consortium. But besides that we have no connection to REDCap. We are just REDCap users.
This project does not distribute REDCap and will never do. Its just a wrapper to help deploy REDCap.
Users still need to provide their own copy of REDCap.
Caution
We are not responsible for any data loss or damage that may occur from the use of our container image. Use it at your own risk. Make backups!
We drive our infrastructure with an emphasis on automation and reproducibility with containerization as our tool.
While there are currently great solutions out there like Andys https://github.com/123andy/redcap-docker-compose (Which was a great help to create this repo), we were not able to adapt REDCap to our environemnt without manual intervention.
This is our try, to containerize REDCap in a way, we can deploy a new instance, without the need for manual intervention during setup.
- IT Operators: Professionals with knowledge of container operations who need to deploy and manage a REDCap instances.
- REDCap Admins: Users familiar with Docker or Podman who require local instances of REDCap for testing or experimentation.
- Automated installation without the need to copy and run REDCap generated SQL scripts
- REDCap Database configuration via env vars
- REDCap Application configuration via env vars
- Automated basic routine task like deactivating the default admin (Optionaly)
- Provide simple mail setup (msmtprc config via env vars)
- "Cron mode" to run the same image as REDCap cronjob manager
- User provisioning via env vars and/or yaml files
- Update user admin priviledges for existing (also external like ldap or oauth2 ) users
- Testing if REDCap upgrades work with this setup (probably will)
- Project provisioning
We assume some basic knowledge about
docker
anddocker compose
and that it is installed
🔋🛑 Batteries not included! Due to the way how REDCap is licensed, you still need to provide the REDCap source-code/php-scripts.
Have a look in the example section for a minimal docker compose that you can start right now.
see config_vars_list.md for all available variables.
You can configure the REDCap instance with env vars. Just prefix the config variables available in the REDCap database table redcap_config
with RCCONF_
see REDCap application env vars for a list of (almost) all available options
see config_vars_list.md#msmtp for mail config vars
you can use the same docker image to run the REDCap cron process.
Just set the env var CRON_MODE
to true.
HINT: You still need to run a second container with the REDCap webserver)
see config_vars_list.md#cron for all env var options
see Cron example compose how to configure it next to a REDCap instance
This container image can prefill your REDCap instance with table users based on json in the environemnt variable USER_PROV
.
But there are also different options:
See the manual at USER_PROV.md for more details.
See the list of env vars concerning user provisiong at USER_PROV.md for more details.
Have a look at the docker compose example how it works in action.
Important
If you are using user provisioning you also want to enable the table based authentication method to table
. env var: RCCONF_auth_meth_global=table
.
This directory must contain the REDCap php scripts.
/var/www/html
This dir can be changed via env var APACHE_DOCUMENT_ROOT
Put any custom php ini config in this directory to be included in the php configuration. See https://www.php.net/manual/en/ini.list.php for all config variables
/config/php/custom_inis
This dir can be changed via env var PHP_INI_SCAN_DIR
/config/apache/custom.virtualhost
This is optional
You can provide the REDCap installation script (generated by http(s)://<myredcapdomain>/install.php
)
/config/redcap/install/install.sql
If the script is existent and REDCap is considered to be not installed (there is no redcap_config
table in the database)
We will run this script at startup.
This dir can be changed via env var REDCAP_INSTALL_SQL_SCRIPT_PATH
If the file is not provided, we will just pull a generic version it from the REDCap sources you provided.
/opt/redcap-docker/users
directory that will be scanned for user data to be provisioned. See User provisioning for more details.
By the default the REDCap user uploaded filw will be saved into your document root dir /var/www/html/edocs
. But as stated by the REDCap manual you may want to change that.
This is easy with this container image, Just set RCCONF_edoc_path
(e.g. RCCONF_edoc_path=/data
) to the path of your choice and mount this path via docker to your host system.
Have a look at the docker compose example how it works in action.
If you are not happy with the file ownership UID/GID of the containers internal apache run user, have a look at WWW_DATA_UID
/WWW_DATA_GID
.