Skip to content

Docker Deployment

Docker Compose is the recommended way to deploy Bizon Platform.

  1. Clone the Repository

    Terminal window
    git clone https://github.com/bizon-data/bizon-platform.git
    cd bizon-platform
  2. Configure Environment

    Terminal window
    cp .env.example .env
    # Edit .env with your configuration
  3. Start Services

    Terminal window
    docker compose up -d
  4. Access the Platform

The default docker-compose.yml includes:

ServicePortDescription
ui5173React frontend (nginx)
api8000FastAPI backend
worker-Job executor
db5432PostgreSQL
Terminal window
# Required
DATABASE_URL=postgresql+asyncpg://bizon:secure-password@db:5432/bizon
JWT_SECRET_KEY=your-256-bit-secret
ENCRYPTION_KEY=your-fernet-key
# Recommended
CORS_ALLOWED_ORIGINS=["https://your-domain.com"]
FRONTEND_URL=https://your-domain.com
Terminal window
# Scale to 4 workers
docker compose up -d --scale worker=4
services:
api:
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '0.5'
memory: 512M
worker:
deploy:
resources:
limits:
cpus: '1'
memory: 1G
version: '3.8'
services:
db:
image: postgres:14
environment:
POSTGRES_USER: bizon
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: bizon
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U bizon"]
interval: 5s
timeout: 5s
retries: 5
api:
build: .
depends_on:
db:
condition: service_healthy
environment:
DATABASE_URL: postgresql+asyncpg://bizon:${DB_PASSWORD}@db:5432/bizon
JWT_SECRET_KEY: ${JWT_SECRET_KEY}
ENCRYPTION_KEY: ${ENCRYPTION_KEY}
ports:
- "8000:8000"
worker:
build: .
command: python -m bizon_platform.worker
depends_on:
db:
condition: service_healthy
environment:
DATABASE_URL: postgresql+asyncpg://bizon:${DB_PASSWORD}@db:5432/bizon
ENCRYPTION_KEY: ${ENCRYPTION_KEY}
ui:
build: ./ui
ports:
- "5173:80"
depends_on:
- api
volumes:
postgres_data:

Development Override (docker-compose.dev.yml)

Section titled “Development Override (docker-compose.dev.yml)”
version: '3.8'
services:
api:
volumes:
- ./bizon_platform:/app/bizon_platform
- ${BIZON_CORE_PATH}:/app/bizon-core
environment:
DEBUG: "true"
ui:
build:
context: ./ui
dockerfile: Dockerfile.dev
volumes:
- ./ui/src:/app/src
ports:
- "5173:5173"

Use with:

Terminal window
docker compose -f docker-compose.yml -f docker-compose.dev.yml up
Terminal window
curl http://localhost:8000/api/health
# {"status": "healthy"}
Terminal window
docker compose exec api python -c "from bizon_platform.db.session import test_connection; test_connection()"
Terminal window
docker compose logs -f
Terminal window
docker compose logs -f api
docker compose logs -f worker
Terminal window
docker compose exec db pg_dump -U bizon bizon > backup.sql
Terminal window
cat backup.sql | docker compose exec -T db psql -U bizon bizon
Terminal window
docker compose exec api alembic upgrade head
Terminal window
docker compose restart api worker
Terminal window
# Check logs
docker compose logs api
# Verify database is ready
docker compose ps db
  1. Check DB container is running
  2. Verify DATABASE_URL format
  3. Check network connectivity
  1. Verify worker containers are running
  2. Check worker logs for errors
  3. Verify database connectivity
  • Set strong JWT_SECRET_KEY (256-bit)
  • Set strong ENCRYPTION_KEY
  • Set strong database password
  • Configure CORS origins
  • Set up reverse proxy (nginx/Traefik)
  • Enable TLS/HTTPS
  • Configure log aggregation
  • Set up monitoring
  • Configure database backups
  • Scale workers appropriately