This document provides instructions for setting up, building, and deploying the IaM-Alliance Vetting System using Docker.
- Docker installed on your system
- Docker Compose installed on your system
- Git (optional, for version control)
- Clone or download the repository
- Run the build script to create the Docker image:
chmod +x build-docker.sh ./build-docker.sh
- Start the application with Docker Compose:
docker compose up -d
- Access the application at http://localhost:5000
Create a .env file in the project root to configure the application:
# Database
POSTGRES_USER=postgres
POSTGRES_PASSWORD=your_secure_db_password
POSTGRES_DB=iam_alliance
# Security
SESSION_SECRET=your_secure_session_key
# Matrix API (if used)
MATRIX_ADMIN_TOKEN=your_matrix_token
# Email Configuration (if used)
SMTP_RELAY_SERVER=your_smtp_server
MAILJET_API_KEY=your_mailjet_key
MAILJET_SECRET_KEY=your_mailjet_secret
./build-docker.shThis creates a Docker image with a timestamp tag and the latest tag.
To update the application with the latest code changes:
./update-docker.shThis script:
- Pulls the latest code (if in a Git repository)
- Rebuilds the Docker image
- Restarts the containers with the new image
To update system and Python packages:
./update-packages.shThis script:
- Creates a new Docker image with updated packages
- Restarts the containers with the updated image
To deploy to a production environment:
./deploy-docker.sh your-registry.com [username] [password]This script:
- Builds and tags the Docker image
- Pushes the image to the specified registry
- Creates a
docker-compose.prod.ymlfile for production deployment
On your production server:
- Copy the
docker-compose.prod.ymlfile - Create a
.envfile with production values - Run:
docker compose -f docker-compose.prod.yml up -d
- Database data is stored in a Docker volume named
postgres_data - Uploaded files are stored in the
uploadsdirectory, which is mounted as a volume
To view logs from the containers:
# All containers
docker compose logs
# Specific container
docker compose logs web
docker compose logs db
# Follow logs
docker compose logs -fIf the web application cannot connect to the database:
-
Check if the database container is running:
docker compose ps
-
Check database logs:
docker compose logs db
-
Verify environment variables in the
.envfile
-
Check application logs:
docker compose logs web
-
Access a shell in the web container for debugging:
docker compose exec web bash
To stop and remove containers:
docker compose downTo stop containers, remove volumes, and remove images:
docker compose down -v --rmi all