Spaces:
Paused
Paused
| # Deploy Catacomb Underwriter Service to Devnet | |
| set -e | |
| echo "=== Deploying Catacomb Underwriter Service to Devnet ===" | |
| # Check if .env exists | |
| if [ ! -f .env ]; then | |
| echo "Creating .env from .env.example..." | |
| cp .env.example .env | |
| echo "⚠️ Please edit .env with your actual devnet credentials:" | |
| echo " - DATABASE_URL (PostgreSQL)" | |
| echo " - REDIS_URL (Redis)" | |
| echo " - STRIPE_SECRET_KEY (test mode)" | |
| echo " - STRIPE_PUBLISHABLE_KEY (test mode)" | |
| echo " - SECRET_KEY" | |
| exit 1 | |
| fi | |
| # Install dependencies | |
| echo "Installing Python dependencies..." | |
| pip install -r requirements.txt | |
| # Initialize database | |
| echo "Initializing database..." | |
| python -c " | |
| from database import get_database_manager | |
| db = get_database_manager() | |
| db.initialize_schema() | |
| print('Database schema initialized') | |
| " | |
| # Start Redis (if not running) | |
| echo "Checking Redis..." | |
| if ! redis-cli ping > /dev/null 2>&1; then | |
| echo "⚠️ Redis not running. Start Redis with: redis-server" | |
| echo " For distributed scaling, use Redis Cluster" | |
| fi | |
| # Start the service | |
| echo "Starting underwriter service on port 5002..." | |
| export FLASK_ENV=production | |
| export FLASK_DEBUG=0 | |
| python underwriter_app.py | |