33800 Docs

← Retour

Proposition de Déploiement - HelloCar API (PROD)

Date : 08/12/2024 02:56 Status : IMPLEMENTEE Projet : hellocar Service : api Environnement : PROD


📋 Résumé

Déploiement du service hellocar-api en production.

Propriété Valeur
Type bun (Elysia)
Port 4510
Domaine hellocar-api-prod.33800.nowhere84.com
Path source apps/api

🔐 Variables d'environnement

Variable Source Valeur PROD
NODE_ENV @ENV production
API_PORT static 4510
API_HOST static 0.0.0.0
SUPABASE_URL @SUPABASE_URL (depuis prod.env)
SUPABASE_SERVICE_ROLE_KEY @SUPABASE_SERVICE_ROLE_KEY (depuis prod.env)
TZ @TZ (depuis prod.env)

Parité secrets PROD/DEV validée (3 clés identiques)


🏗️ Étapes de déploiement

  1. Build du package common (monorepo dependency)

    cd /tmp/hellocar && pnpm install && pnpm --filter @hellocar/common build
  2. Build du service api

    cd /tmp/hellocar/apps/api && bun install && bun run build
  3. Création docker-compose.yml

    • Image : oven/bun:latest
    • Port exposé : 4510
    • Restart : unless-stopped
  4. Déploiement via Portainer

    • Stack name : hellocar-api-prod
    • Network : traefik-public (ou bridge)
  5. Configuration Nginx (à noter pour phase 2)

    • Proxy vers 192.168.1.11:4510

📁 Fichiers générés

/mnt/stock_36to/data/docker/stacks/hellocar-api-prod/
├── docker-compose.yml
├── .env
└── app/ (code buildé)

⚠️ Points d'attention


✅ Validation requise

Commande : Répondez oui pour lancer le déploiement.