This repository contains code for constructing the docker image of TCRD (Target Central Resource Database).
At the time of writing the DB platform used is mysql.
Note that the code within this repository relies on an existing dump of the TCRD database. For the TCRD source code please see:
- Docker
- At least 140GB of free storage space
- (Recommended) at least 32GB of RAM
-
Copy
.env.exampleto.envand edit values to match your environment:cp .env.example .env
Variable Description CPUSCPU cores allocated to the container (decimals accepted, e.g. 4.5)MEMORYRAM allocated to the container — suffix must be GorM(e.g.32G)MYSQL_ROOT_PASSWORDRoot password for the MySQL instance MYSQL_DATABASEName of the database to create and restore into DB_USERRead-only user created after restore DB_PASSWORDPassword for the read-only user HOST_PORTHost port mapped to MySQL's container port 3306 -
Run tune.sh to generate a MySQL configuration file based on your resources params (
CPUSandMEMORY) -
Run docker compose:
docker compose up -d
One can track the progress of the restore with:
docker compose logs -f
The DB will take some time to restore, it takes about 10 hours using
CPUS=8andMEMORY=128G(vanilla mysql restore is very slow).The container will be ready to use once you see a message like the following:
[Server] /usr/sbin/mysqld: ready for connections. -
After the DB restore/initialization is complete one can connect to the database like so from the host:
# use DB_PASSWORD when prompted for password mysql -D tcrd -u <DB_USER> -P <HOST_PORT> -h 127.0.0.1 -p