This repository contains code for constructing the docker image of the TIN-X database.
At the time of writing the DB platform used is mysql.
- Docker
- At least 90GB 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 2 hours using
CPUS=8andMEMORY=128G.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
On the TIN-X production server (chiltepin.health.unm.edu) the following command was executed against a live version of the TIN-X database:
# Step 1: Install mysqlsh into the already-running container
# (MySQL repo is already configured in the image, so this just works)
docker-compose exec mysql microdnf install -y mysql-shell
# Step 2: Run the schema dump (inside the container, output to /tmp)
docker-compose exec mysql mysqlsh root@localhost \
-- util dump-schemas tcrd \
--outputUrl=/tmp/tcrd-shell-dump \
--threads=8 \
--compression=zstd
# Step 3: Tar it up inside the container
docker-compose exec mysql tar -czf /tmp/tinx-mysql-shell.tar.gz \
-C /tmp tcrd-shell-dump/
# Step 4: Copy the tarball out to the host
docker cp $(docker-compose ps -q mysql):/tmp/tinx-mysql-shell.tar.gz ./This dump file was generated on 03/26/2026.