Skip to content

Deployment (Administrator)

Guide for DevOps and system administrators.

Deployment options

Method When to use
GitHub Actions Production (recommended)
deploy.sh Manual deploy on VPS
Docker Compose Local / staging

Quick production deploy (GitHub Actions)

  1. Configure Secrets in the valera7623/MedInsight repository:
  2. VPS_HOST, VPS_USER, VPS_SSH_KEY
  3. SECRET_KEY, APP_PORT, CORS_ORIGINS
  4. Push to main triggers .github/workflows/deploy.yml.
  5. Pipeline: testdeploy (SSH to VPS).
gh run list --workflow=deploy.yml --limit 1
gh run watch --exit-status

Manual deploy on VPS

ssh medinsight-vps
cd ~/medinsight
git fetch origin && git reset --hard origin/main
./deploy.sh production

The deploy.sh script:

  • copies .env from .env.production (if present);
  • builds images docker compose -f docker-compose.prod.yml build;
  • starts services up -d;
  • applies SQL migrations from app/db/migrations/;
  • runs scripts/docker_cleanup.sh deploy.

Post-deploy check

curl -s http://localhost:8000/health/ready
# {"status":"ready","database":"ok","redis":"ok"}

VPS layout

~/medinsight/
├── .env                 # secrets (not in git)
├── docker-compose.prod.yml
├── storage/             # encrypted files + DICOM
├── backups/             # age archives
└── deploy.sh

Ports

Service Port (default)
FastAPI (app) 8000
Redis 6379 (inside Docker)

Nginx/Caddy on the VPS proxies HTTPS → localhost:8000.

More detail