Deployment¶
Purpose¶
Provide a reliable deploy runbook for OpenSESA runtime promotion.
Because OpenSESA is open source and free to use, this runbook is designed for teams operating their own production environments.
Deployment Workflow¶
flowchart LR
Prep["Prepare Env"] --> Up["Start Deploy Stack"]
Up --> Migrate["Run Migrations"]
Migrate --> Static["Collect Static"]
Static --> Check["Run Django Checks"]
Check --> Verify["Verify Logs and Critical Flows"] Step-by-Step¶
- prepare environment-specific
.env - pull deploy images
- start deploy stack
- apply migrations
- collect static assets
- run checks
- validate runtime and critical workflows
Commands¶
# set this if your deployment compose file uses a different name/path
DEPLOY_COMPOSE_FILE=docker-compose-deploy.yml
docker compose -f "$DEPLOY_COMPOSE_FILE" pull
docker compose -f "$DEPLOY_COMPOSE_FILE" up -d
docker compose -f "$DEPLOY_COMPOSE_FILE" down
docker compose -f "$DEPLOY_COMPOSE_FILE" run --rm <deploy-app-service> python manage.py migrate
docker compose -f "$DEPLOY_COMPOSE_FILE" run --rm <deploy-app-service> python manage.py collectstatic --noinput
docker compose -f "$DEPLOY_COMPOSE_FILE" run --rm <deploy-app-service> python manage.py check
docker compose -f "$DEPLOY_COMPOSE_FILE" logs -f
Image Pull Strategy¶
- use
docker compose -f docker-compose-deploy.yml pullbefore each rollout - pin explicit image tags in deploy compose for reproducible promotions
- avoid relying on floating tags in production unless your release policy explicitly allows it
- avoid
--buildin production rollouts when deploying prebuilt/pinned images
Compose File Naming¶
- this guide uses
docker-compose-deploy.ymlas a conventional deploy file name - if your environment uses a different file name or location, set
DEPLOY_COMPOSE_FILEaccordingly
Post-Deploy Validation¶
- login/auth workflows
- key domain pages (requirements, V&V, baseline, ops)
- worker health and queue processing
Failure Modes¶
| Symptom | Likely Cause | Fix |
|---|---|---|
| app boots but login fails | host/csrf mismatch | validate env and ingress config |
| static assets missing | collectstatic not applied or path mismatch | rerun collectstatic with correct app service |
| async outcomes missing | worker/broker issue | validate celery/redis health |
Migration safety
Ensure backup/recovery readiness before schema changes in production-like environments.