A from-scratch rewrite of the Drug-Gene Interaction Database.
First, make sure you have all of the following installed:
- mise. The easiest method is
brew install mise. You will likely also want to automatically activate it in your shell. - PostgreSQL, either from here or here
Clone and enter the repository:
git clone https://github.com/dgidb/dgidb-v5
cd dgidb-v5Then install the correct versions of node, ruby, and python by running the following:
mise trust
mise installThis will also automaticaly set up and activate a python virtualenv.
From the repo root, enter the server subdirectory:
cd serverNext, install Rails and other required gems with bundle:
bundle installThe server will need a running Postgres instance. Postgres start commands may vary based on your OS and processor type. The following should work on M1 Macs:
pg_ctl -D /opt/homebrew/var/postgres start
# on older macs you may need to use a different path instead, eg "pg_ctl -D /usr/local/var/postgres start"Create the database and load in the schema:
rails db:setupNext, import a database dump file (ask on Slack if you need the latest file):
psql -d dgidb -f dgidb_dump_20220526.psql # provide path to data dumpThat should take a few minutes. Finally, start the Rails server:
rails sNavigate to localhost:3000/api/graphiql in your browser. If the example query provided runs successfully, then you're all set.
To perform a data load from scratch, first run the reset task to provide a clean, seeded DB:
rake db:resetSome Python libraries are required for importing data. From the repo root, install required dependencies:
pip install -r scripts/requirements.txtA Python script is supplied to ensure that primary source data is available. This can also be used to acquire new versions of data that supply discrete releases (like ChEMBL):
python scripts/download_files.py
Then, load claims:
rake dgidb:import:allThen, run grouping. See documentation for the therapy and gene normalizers for more.
By default, the groupers will expect a normalizer service to be running locally on port 8000; use the THERAPY_HOSTNAME and GENE_HOSTNAME environment variables to specify alternate hosts:
export THERAPY_HOSTNAME=http://localhost:7999
rake dgidb:group:drugs
export GENE_HOSTNAME=http://localhost:7998
rake dgidb:group:genes
rake dgidb:group:interactionsFinally, normalize remaining metadata:
rake dgidb:normalize:drug_approval_ratings
rake dgidb:normalize:drug_types
rake dgidb:normalize:populate_source_countersNavigate to the /client directory:
# from dgidb-v5 root
cd clientInstall dependencies with yarn:
yarn installStart the client:
yarn startFrontend style is enforced by ESLint and Prettier. Conformance is ensured by pre-commit. Before your first commit, run
pre-commit installIn practice, Prettier will do most of the formatting work for you to be in accordance with ESLint. Run the following to autoformat a file:
yarn run prettier --write path/to/fileThe published images support Linux on AMD64 and ARM64. Docker selects the correct image automatically, including on Apple silicon. The application image contains Rails, the production React bundle, and Thruster. The database image contains PostgreSQL 18 with the DGIdb dataset already loaded. Docker Compose is the only runtime dependency.
Download compose.yaml and .env.example from the same DGIdb release into an empty directory. Create the environment file and replace its placeholder with a random secret; openssl rand -hex 64 is one way to generate it.
cp .env.example .envPull and start the public images; no source checkout or image build is needed:
docker compose pull
docker compose up --detach
docker compose logs --follow db appOpen http://localhost:8080. The database is read-only, starts from the dataset built into its image, and is not exposed to the host.
To update the application or dataset, repeat docker compose pull and docker compose up --detach. There is no database volume or startup import: changing the database image changes the dataset. Set DGIDB_APPLICATION_IMAGE and DGIDB_DATABASE_IMAGE in .env when you want to pin published tags or digests instead of latest.
Thruster listens over HTTP in the supplied Compose configuration. Terminate TLS at the deployment platform or load balancer.
Maintainers build and push both Linux architectures with the standalone build configuration:
docker login ghcr.io
DGIDB_DATA_RELEASE=2026-06b docker compose -f compose.build.yaml build --pushThe database is initialized and loaded entirely during this build. Use a concrete DGIDB_DATA_RELEASE tag so the result is reproducible. Set DGIDB_APPLICATION_IMAGE or DGIDB_DATABASE_IMAGE to publish a non-latest image tag. Docker Desktop supplies cross-architecture emulation on Apple silicon. After first publishing each package, set its GHCR visibility to public so users can pull it without signing in.