Scripts Reference
This section provides a reference for the scripts included in this project.
run.sh
This script is used to start the application in development mode.
- Usage:
./run.sh - Functionality:
- Starts the Docker containers defined in
docker-compose.dev.yaml. - Enables hot-reloading for the services, so that changes to the source code are automatically applied.
- Sets up a trap to automatically stop and remove the containers when the script is terminated.
- Starts the Docker containers defined in
build.sh
This script is used to build and push the Docker images for all the services to a Docker registry.
- Usage:
./build.sh - Functionality:
- Reads the
DOCKER_REGISTRYenvironment variable from the.envfile. - Builds a Docker image for each service in the
servicesdirectory, as well as fordb-prestart,db-backup, andshared-data. - Pushes the images to the configured Docker registry.
- Reads the
- Prerequisites:
- The
DOCKER_REGISTRYenvironment variable must be set. - You must be logged in to the Docker registry (
docker login). - Lock files (
uv.lock,package-lock.json) must be present.
- The
manual_backup.sh
This script is used to create a manual backup of the PostgreSQL database.
- Usage:
./manual_backup.sh <DB_HOST> [DB_PORT] - Functionality:
- Connects to the specified database and and creates a compressed backup file.
- The backup file is stored in the directory specified by the
BACKUP_DIRenvironment variable.
- Prerequisites:
- The
.envfile must contain theDB_NAME,POSTGRES_ADMIN_USER,POSTGRES_ADMIN_PASSWORD, andBACKUP_DIRvariables.
- The
restore_backup.sh
This script is used to restore the PostgreSQL database from a backup file.
- Usage:
./restore_backup.sh <PATH_TO_BACKUP_FILE> <DB_HOST> [DB_PORT] - Functionality:
- Drops the existing database.
- Creates a new database.
- Restores the data from the specified backup file.
- Prerequisites:
- The
.envfile must contain theDB_NAME,POSTGRES_ADMIN_USER, andPOSTGRES_ADMIN_PASSWORDvariables.
- The
- Warning: This is a destructive operation that will completely erase the existing database.