new version

This commit is contained in:
ZOMBIIIIIII
2026-04-14 20:22:51 +03:00
parent 37146f7375
commit 89cb6174b7
144 changed files with 1710 additions and 17258 deletions

54
start.sh Normal file
View File

@@ -0,0 +1,54 @@
#!/bin/bash
set -euo pipefail
cd "$(dirname "$0")"
echo "=========================================="
echo " CryptoWallet API - Production Deploy"
echo "=========================================="
# 1. Docker check
command -v docker >/dev/null || { echo "[ERROR] Docker not installed"; exit 1; }
docker compose version >/dev/null 2>&1 || { echo "[ERROR] docker compose plugin missing"; exit 1; }
# 2. .env check
if [ ! -f .env ]; then
cp .env.example .env
echo "[INFO] Created .env from .env.example"
echo "[INFO] Fill in VAULT_ROLE_ID, VAULT_SECRET_ID and re-run."
exit 1
fi
# 3. Build & start
echo "[INFO] Building image..."
docker compose build --pull api
echo "[INFO] Starting services..."
docker compose up -d
# 4. Wait for health
echo "[INFO] Waiting for API to be healthy..."
for i in $(seq 1 60); do
if curl -sf http://localhost:3001/api/health >/dev/null 2>&1; then
echo "[OK] API healthy"
break
fi
if [ "$i" = "60" ]; then
echo "[ERROR] API did not become healthy in 120s"
docker compose logs --tail=50 api
exit 1
fi
sleep 2
done
echo ""
echo "=========================================="
echo " Deploy complete"
echo ""
echo " API: http://localhost:3001"
echo " Health: http://localhost:3001/api/health"
echo " Docs: http://localhost:3001/api/docs"
echo ""
echo " Logs: docker compose logs -f api"
echo " Stop: docker compose down"
echo "=========================================="