Some checks failed
Deploy to Production / deploy (push) Failing after 0s
- Complete dark-theme redesign inspired by ai-impress.com (navy + cyan + violet palette) - New Syne display font + gradient logo mark + SVG favicon - New Navigation: glass-morphism, gradient logo, Get Started CTA - New Hero: animated glow orbs, mock focus-group chat UI, stats row - New landing: Features grid, How-It-Works steps, CTA banner - New Footer: AImpress LTD branding, © AImpress LTD. All rights reserved. - New Login page: dark card, password visibility toggle, link to Register - New Register page: full form, benefits row, 50 free credits pitch - New VerifyEmail page: token verification flow with auto-redirect - Backend: email_service.py using Resend API for verification emails - Backend: /api/auth/register, /verify-email, /resend-verification endpoints - User model: email_verified, email_verify_token, email_verify_expires fields - Gitea Actions CI/CD: auto-deploy to aimpress server on push to main Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
67 lines
2.7 KiB
Bash
Executable file
67 lines
2.7 KiB
Bash
Executable file
#!/bin/bash
|
|
# Cohorta — deploy script for aimpress (OVH) server
|
|
# Run from the server: /opt/03-business/cohorta/deploy-cohorta.sh
|
|
#
|
|
# Prerequisites on server:
|
|
# - Docker + Docker Compose plugin installed
|
|
# - Traefik running with network "traefik-public" and letsencrypt certresolver
|
|
# - DNS A record: cohorta.ai-impress.com → 57.128.160.249
|
|
# - backend/.env filled with production secrets (see backend/.env.example)
|
|
|
|
set -euo pipefail
|
|
|
|
BLUE='\033[0;34m'
|
|
GREEN='\033[0;32m'
|
|
RED='\033[0;31m'
|
|
NC='\033[0m'
|
|
|
|
DEPLOY_DIR="/opt/03-business/cohorta"
|
|
|
|
echo -e "${BLUE}=== Cohorta — deploy ===${NC}"
|
|
|
|
# ── 1. Pull latest code ───────────────────────────────────────────────────────
|
|
echo "Pulling latest code..."
|
|
git -C "$DEPLOY_DIR" pull --ff-only
|
|
|
|
# ── 2. Ensure traefik-public network exists ───────────────────────────────────
|
|
if ! docker network ls --format '{{.Name}}' | grep -q '^traefik-public$'; then
|
|
echo "Creating traefik-public network..."
|
|
docker network create traefik-public
|
|
fi
|
|
|
|
# ── 3. Add swap if not present (helps with AI-heavy workloads) ───────────────
|
|
if ! swapon --show | grep -q swapfile 2>/dev/null; then
|
|
if [ ! -f /swapfile ]; then
|
|
echo "Creating 4 GB swap..."
|
|
fallocate -l 4G /swapfile
|
|
chmod 600 /swapfile
|
|
mkswap /swapfile
|
|
swapon /swapfile
|
|
echo '/swapfile none swap sw 0 0' >> /etc/fstab
|
|
echo "vm.swappiness=10" >> /etc/sysctl.conf
|
|
sysctl -p
|
|
fi
|
|
fi
|
|
|
|
# ── 4. Build and launch containers ────────────────────────────────────────────
|
|
echo "Building and launching containers..."
|
|
cd "$DEPLOY_DIR"
|
|
docker compose pull mongo 2>/dev/null || true
|
|
docker compose build --no-cache frontend backend
|
|
docker compose up -d --remove-orphans
|
|
|
|
# ── 5. Wait for backend health ────────────────────────────────────────────────
|
|
echo "Waiting for backend to start..."
|
|
for i in $(seq 1 30); do
|
|
if curl -sf http://localhost:5137/api/health > /dev/null 2>&1; then
|
|
echo -e "${GREEN}✓ Backend is healthy${NC}"
|
|
break
|
|
fi
|
|
sleep 2
|
|
done
|
|
|
|
# ── 6. Show status ────────────────────────────────────────────────────────────
|
|
docker compose ps
|
|
echo ""
|
|
echo -e "${GREEN}=== Deploy complete ===${NC}"
|
|
echo " https://cohorta.ai-impress.com"
|