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)¶
- Configure Secrets in the
valera7623/MedInsightrepository: VPS_HOST,VPS_USER,VPS_SSH_KEYSECRET_KEY,APP_PORT,CORS_ORIGINS- Push to
maintriggers.github/workflows/deploy.yml. - Pipeline: test → deploy (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
.envfrom.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.