Server Deployment
This guide covers deploying Ody's Rope to a production server.
Deployment Methods
GitHub Actions (Recommended)
The repository includes a GitHub Actions workflow at .github/workflows/deploy.yml.
QA (automatic)
Merging a pull request into main deploys to QA automatically.
Production (manual)
- Go to the Actions tab → Deploy workflow
- Click Run workflow
- Select Production and the branch to deploy (usually
main) - Click Run workflow
You can also run a manual QA deploy from any branch via Run workflow → QA.
Manual Deployment
If you prefer manual deployment:
1. SSH to Server
ssh user@your-server.com
2. Clone/Update Repository
cd /var/www/starteralgo
git pull origin main
3. Install Dependencies
pip install -r requirements.txt
4. Run Migrations
alembic upgrade head
5. Restart Application
systemctl restart starteralgo
Docker Deployment
Using Docker Compose
docker-compose up -d
Docker Configuration
The docker-compose.yml file configures:
- Flask application container
- Nginx reverse proxy
- Volume mounts for persistent data
Environment Variables
Set these environment variables in production:
| Variable | Description |
|---|---|
FLASK_SECRET_KEY | Flask secret key |
DATABASE_URL | Database connection string |
WORKOS_CLIENT_ID | WorkOS client ID |
WORKOS_API_KEY | WorkOS API key |
Nginx Configuration
The default Nginx configuration is in nginx/conf.d/default.conf:
server {
listen 80;
server_name your-domain.com;
location / {
proxy_pass http://127.0.0.1:4000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
SSL/TLS Setup
For production, always use HTTPS. Use Let's Encrypt for free SSL certificates:
certbot --nginx -d your-domain.com
Monitoring
Application Logs
Logs are stored in the logs/ directory:
tail -f logs/app.log
Process Status
Check if the application is running:
systemctl status starteralgo
Troubleshooting
Application won't start
- Check logs:
tail -f logs/app.log - Verify environment variables are set
- Check database connectivity
- Ensure port 4000 is not in use
Database migration errors
- Check Alembic migration history:
alembic history - Verify database permissions
- Run migrations manually:
alembic upgrade head
Nginx 502 Bad Gateway
- Check if Flask app is running
- Verify Nginx configuration
- Check firewall rules