-
Install Docker to your laptop
-
Prepare the data and create a Data folder under the root project directory.
-
Prepare the example data and create a example_data folder under the Backend directory.
-
Create a .env file under the root project directory
DB_USERNAME=admin DB_HOST=db DB_NAME=chromosome_db DB_PASSWORD=chromosome DB_PORT=5432 PGADMIN_DEFAULT_EMAIL=[email protected] PGADMIN_DEFAULT_PASSWORD=chromosome REDIS_HOST=redis REDIS_PORT=6379 REDIS_DB=0 REDIS_BROKER_DB=1 REDIS_TASK_DB=2
-
For development, under this project folder, and run
docker compose up -d --build
- Switch to publish branch
git switch publish - Build
docker compose -f docker-compose.prod.yml up -d --build
# All services
docker compose logs -f
# Specific service
docker compose logs -f backendIf you want to restart a service that has already been deployed on the server, you need to add -f docker-compose.prod.yml, for example:
# Restart all service on the server
docker compose -f docker-compose.prod.yml restartOtherwise, using:
# Restart all
docker compose restart
# Restart specific service
docker compose restart backend# Check database connection
docker compose exec db psql -U $DB_USERNAME -d $DB_NAMEdocker exec -it Redis redis-cli FLUSHALLdocker builder prune --alldocker exec -it <container ID> bashTake GM12878-chr8-127300000-128300000 as an example
psql -U admin -d chromosome_db \
--command "\copy (SELECT * FROM public.distance WHERE cell_line = 'GM12878' AND chrid = 'chr8' AND start_value = 127300000 AND end_value = 128300000) TO '/opt/GM12878_chr8_127300000_128300000_original_distance.csv' WITH (FORMAT csv, HEADER, DELIMITER ',', QUOTE '\"', ESCAPE '''');"If your Docker is running on the server, you need to download this file from the container to your server
# Exit DB Container
exit
# Run
docker cp <container>:/path/in/container /path/on/host