Budget-friendly for MVPs
Enterprise-ready infrastructure
Self-hosted with full control
# Multi-stage build for TaskFlow AI FROM node:18-alpine AS builder WORKDIR /app COPY package*.json ./ RUN npm ci --only=production COPY . . RUN npm run build FROM node:18-alpine AS runner WORKDIR /app RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs COPY --from=builder /app/public ./public COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static USER nextjs EXPOSE 3000 ENV PORT 3000 CMD ["node", "server.js"]
version: '3.8' services: app: build: . ports: - "3000:3000" environment: - NODE_ENV=production - DATABASE_URL=postgresql://user:pass@db:5432/taskflow - REDIS_URL=redis://redis:6379 depends_on: - db - redis restart: unless-stopped db: image: postgres:15-alpine environment: POSTGRES_DB: taskflow POSTGRES_USER: user POSTGRES_PASSWORD: pass volumes: - postgres_data:/var/lib/postgresql/data restart: unless-stopped redis: image: redis:7-alpine restart: unless-stopped traefik: image: traefik:v3.0 command: - "--api.insecure=true" - "--providers.docker=true" - "--entrypoints.web.address=:80" - "--entrypoints.websecure.address=:443" - "--certificatesresolvers.myresolver.acme.tlschallenge=true" - "--certificatesresolvers.myresolver.acme.email=your@email.com" - "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json" ports: - "80:80" - "443:443" - "8080:8080" volumes: - /var/run/docker.sock:/var/run/docker.sock:ro - letsencrypt:/letsencrypt restart: unless-stopped volumes: postgres_data: letsencrypt:
# TaskFlow AI Deployment Configuration PROJECT_NAME=taskflow-ai ENVIRONMENT=production VERSION=1.0.0 # Database Configuration DB_HOST=localhost DB_PORT=5432 DB_NAME=taskflow DB_USER=user DB_PASSWORD=secure_password_here # Redis Configuration REDIS_HOST=localhost REDIS_PORT=6379 # Application Configuration APP_PORT=3000 APP_HOST=0.0.0.0 JWT_SECRET=your-super-secret-jwt-key API_BASE_URL=https://api.taskflow.ai # Monitoring ENABLE_METRICS=true LOG_LEVEL=info SENTRY_DSN=your_sentry_dsn_here # Feature Flags ENABLE_AI_FEATURES=true ENABLE_ANALYTICS=true ENABLE_NOTIFICATIONS=true
#!/bin/bash # TaskFlow AI Deployment Scripts # deploy.sh - Main deployment script deploy() { echo "🚀 Deploying TaskFlow AI..." # Build and deploy based on mode if [ "$DEPLOY_MODE" = "cheap" ]; then deploy_cheap elif [ "$DEPLOY_MODE" = "scale" ]; then deploy_scale elif [ "$DEPLOY_MODE" = "indie" ]; then deploy_indie fi } # Cheap mode deployment (Fly.io) deploy_cheap() { echo "💰 Deploying in Cheap Mode to Fly.io..." fly deploy --config fly.toml fly volumes create data --size 10 fly secrets set DATABASE_URL=$DATABASE_URL } # Scale mode deployment (GCP/Kubernetes) deploy_scale() { echo "📈 Deploying in Scale Mode to GCP..." gcloud builds submit --tag gcr.io/$PROJECT_ID/taskflow-ai kubectl apply -f k8s/ kubectl set image deployment/taskflow-api taskflow-api=gcr.io/$PROJECT_ID/taskflow-ai:latest } # Indie mode deployment (Docker Compose) deploy_indie() { echo "🎨 Deploying in Indie Mode with Docker Compose..." docker-compose down docker-compose build --no-cache docker-compose up -d } # Health check health_check() { curl -f http://localhost:3000/health || exit 1 } # Backup script backup() { pg_dump $DATABASE_URL | gzip > backup_$(date +%Y%m%d_%H%M%S).sql.gz } # Run deployment deploy