This repository contains a Docker Compose setup for deploying the BitDive environment. It includes the following services:
- Vault: A secrets management system.
- PostgreSQL: A database server with SSL configuration.
- MinIO: An object storage service.
- Keycloak: An identity and access management system.
- Monitoring API: A service for monitoring application performance.
- Flink Load: A service for loading data to MinIO.
- File Acceptor: A service for accepting and processing files.
- Frontend: A React-based frontend for the BitDive application.
Ensure that you have the following installed on your system:
- Docker (v20.10+)
- Docker Compose (v1.29+)
Before starting the services, create a .env file in the root directory with the following variables:
SERVER_IP=127.0.0.1
# Vault Configuration
VAULT_ADDR=https://${SERVER_IP}:8200
VAULT_ADDR_CONTAINER=https://vault-server:8200
# PostgreSQL Configuration
POSTGRES_USER=citizix_user
POSTGRES_PASSWORD=your_postgres_password
POSTGRES_DB=data-bitdive
POSTGRES_HOST=postgres-bitdive
POSTGRES_PORT=5432
# MinIO Configuration
MINIO_ROOT_USER=your_minio_user
MINIO_ROOT_PASSWORD=your_minio_passwor
MINIO_DOMAIN=http://${SERVER_IP}
MINIO_CONSOLE_ADDRESS=:9001
MINIO_ENDPOINT=http://minio:9000
# Keycloak Configuration
KEYCLOAK_DB_USERNAME=${POSTGRES_USER}
KEYCLOAK_DB_PASSWORD=${POSTGRES_PASSWORD}
KEYCLOAK_ADMIN=your_keycloak_user
KEYCLOAK_ADMIN_PASSWORD=your_keycloak_password
KEYCLOAK_HTTP_ENABLED=false
KEYCLOAK_HTTP_SSL_PORT=8443
KEYCLOAK_KEY_STORE_PASSWORD=your-keycloak-keystore-password
KEYCLOAK_TRUST_STORE_PASSWORD=your-keycloak-truststore-password
JAVA_KEYSTORE_PASSWORD=your-keystore-password
JAVA_TRUSTSTORE_PASSWORD=your-truststore-password
KEYCLOAK_DB_URL=jdbc:postgresql://${POSTGRES_HOST}:${POSTGRES_PORT}/keycloak?ssl=true&sslmode=verify-full&&sslfactory=org.postgresql.ssl.DefaultJavaSSLFactory
# Vault User Credentials
VAULT_LOGIN=your_vault_login
VAULT_PASSWORD=your_vault_password
# Vault Certificates Configuration
VAULT_CERT_DB_COMMON_NAME=${POSTGRES_USER}
VAULT_CERT_DB_ALT_NAME=${POSTGRES_HOST}
VAULT_CERT_DB_TTL=24h
VAULT_CERT_SERVICE_COMMON_NAME=file-acceptor.bitdive
VAULT_CERT_SERVICE_ALT_NAMES=${SERVER_IP}
VAULT_CERT_SERVICE_TTL=24h
KEYCLOAK_FRONTEND_URL_NOT_SSL=https://${SERVER_IP}:8999
KEYCLOAK_FRONTEND_URL=http://${SERVER_IP}:8999
VAULT_CERT_KEYCLOAK_COMMON_NAME=${SERVER_IP}
VAULT_CERT_KEYCLOAK_ALT_NAME=${SERVER_IP}
VAULT_CERT_KEYCLOAK_TTL=24h
# Keycloak Realm URL
KEYCLOAK_REALM_URL=https://keycloak:${KEYCLOAK_HTTP_SSL_PORT}/realms/bitdive/protocol/openid-connect/certs
KEYCLOAK_REALM_URL_NOT_SSL=http://keycloak:8080/realms/bitdive/protocol/openid-connect/certs
# Frontend Configuration
REACT_APP_API_URL=http://${SERVER_IP}:8081Run the following command to start the Vault service:
docker-compose up vaultWait until Vault is fully initialized.
Run the following command to set up SSL for the PostgreSQL service:
docker-compose up init-db-sslWait until the process completes.
Finally, start all remaining services with:
docker-compose up init-container-ssl- Vault: https://localhost:8200
- PostgreSQL: Accessible on port
5432. - MinIO: http://localhost:9000 (console: http://localhost:9001)
- Keycloak: https://localhost:8443
- Frontend: http://localhost
- Logs and data are persisted in the
./vaultand./postgresqldirectories. - Make sure to replace placeholder values in the
.envfile with actual secrets before starting the services. - If you encounter any issues, verify that all required ports are free and that Docker Compose is up-to-date.
- Vault does not start: Ensure that the configuration file exists in the
./configVaultdirectory and is correctly configured. - PostgreSQL SSL issues: Verify that the certificates in
./vault/ssl/postgres-serverare correctly configured and have proper permissions. - MinIO access issues: Ensure that the
MINIO_ROOT_USERandMINIO_ROOT_PASSWORDin.envmatch the configured values.