# 1. Install dependencies
source .venv/bin/activate
pip install -r requirements.txt
# 2. Set environment variable
export SECRET_KEY="your-32-character-secret-key-here123456"
# 3. Run the app
python main.py
# 4. Test
curl http://localhost:5000/health✅ App runs on http://localhost:5000
# 1. Build Docker image
docker build -t general-biller:latest .
# 2. Run container with environment variables
docker run -d \
--name biller \
-p 5000:5000 \
-e SECRET_KEY="your-secret-key" \
-e ENVIRONMENT="production" \
-v $(pwd)/data:/app/data \
general-biller:latest
# 3. View logs
docker logs -f biller
# 4. Test
curl http://localhost:5000/health✅ App runs in container on http://localhost:5000
# 1. Start all services (app + database)
docker-compose up -d
# 2. View logs
docker-compose logs -f app
# 3. Test
curl http://localhost:5000/health
# 4. Monitor
docker-compose ps✅ Full stack running with PostgreSQL database
Already configured! Your workflow deploys automatically when:
- You push to
mainbranch - All tests pass ✅
- Docker build succeeds ✅
- Deploy job runs ✅
To trigger deployment:
git add .
git commit -m "Deploy update"
git push origin mainThen watch: GitHub → Actions tab → See deploy job run
# Minimum required
export SECRET_KEY="your-32-character-key-minimum"
export ENVIRONMENT="production" # or "development"
# Optional with defaults
export DATABASE_URL="sqlite:///loan_manager.db" # or PostgreSQL
export APP_PORT="5000"
export LOG_LEVEL="INFO"cat > .env << EOF
SECRET_KEY=your-secret-key-here-must-be-32-chars-minimum123456
ENVIRONMENT=production
DATABASE_URL=postgresql://user:password@localhost:5432/biller
APP_PORT=5000
LOG_LEVEL=INFO
ALLOW_ORIGINS=http://localhost:3000,https://yourdomain.com
EOF# Basic health check
curl http://localhost:5000/health
# Detailed readiness check
curl http://localhost:5000/readiness
# API test - Get personal loans
curl -X GET http://localhost:5000/api/v1/personal/loans \
-H "Authorization: Bearer YOUR_JWT_TOKEN"# Docker logs
docker logs biller
# System logs (if using systemd)
sudo journalctl -u biller -f
# Docker Compose logs
docker-compose logs -f app
# File logs
tail -f /var/log/biller/error.log- Uses file-based database
- Perfect for development
- Data persists in
loan_manager.db
# 1. Install PostgreSQL
brew install postgresql # macOS
apt-get install postgresql # Linux
# 2. Create database
createdb general_biller
# 3. Set connection string
export DATABASE_URL="postgresql://user:password@localhost:5432/general_biller"
# 4. Run migrations
alembic upgrade head
# 5. Verify
psql general_biller -c "SELECT version();"| Issue | Solution |
|---|---|
| "Port 5000 already in use" | lsof -i :5000 then kill -9 <PID> or use different port |
| "SECRET_KEY too short" | Ensure 32+ characters: openssl rand -hex 16 |
| "Database connection failed" | Check DATABASE_URL and that database is running |
| "Module not found" | Run pip install -r requirements.txt |
| "Permission denied deploy.sh" | Run chmod +x deploy.sh |
| "Docker not found" | Install Docker from docker.com |
- Tests passing:
pytest tests/ -v - Dependencies installed:
pip install -r requirements.txt -
.envfile configured with all required variables - Database migrations run:
alembic upgrade head - Health endpoint responds:
curl http://localhost:5000/health - API endpoint works: Test one loan endpoint
- Logs configured and readable
- Backup strategy in place
- Firewall rules allow port 5000
- Choose deployment option (A, B, C, or D above)
- Configure environment variables (copy and edit
.env) - Run deployment (follow steps for your chosen option)
- Verify using health check endpoints
- Monitor - Watch logs in production
- Backup - Set up regular database backups
- Check DEPLOYMENT.md for comprehensive guide
- Check DEPLOYMENT_FIX.md for GitHub error fixes
- Review logs:
docker logs billeror/var/log/biller/error.log - Test endpoints with demo:
python demo_api.py
Status: ✅ Your application is ready to deploy!
Deploy now with: docker-compose up -d (Option C - recommended)