33800 Docs

← Retour

Task : Documentation complète du déploiement HelloCar

Date début : 09-12-2024 01:15 Date fin : 09-12-2024 01:30 Statut : ✅ Terminé


Résumé

Documentation complète du système de déploiement HelloCar, incluant :


Services déployés

Service Image Port Container Status
API hellocar-api:prod 4510 hellocar-api-prod 🟢
Public hellocar-public:prod 4501 hellocar-public-prod 🟢
Admin hellocar-admin:prod 4500 hellocar-admin-prod 🟢

Architecture

┌─────────────────────────────────────────────────────────────────┐
│                     Serveur PROD (192.168.1.11)                 │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  ┌─────────────────┐  ┌─────────────────┐  ┌─────────────────┐ │
│  │ hellocar-api    │  │ hellocar-public │  │ hellocar-admin  │ │
│  │ :4510           │  │ :4501           │  │ :4500           │ │
│  │ Elysia + Bun    │  │ Qwik + Node     │  │ Qwik + Node     │ │
│  └────────┬────────┘  └────────┬────────┘  └────────┬────────┘ │
│           │                    │                    │          │
│           └────────────────────┼────────────────────┘          │
│                                │                               │
│                    ┌───────────▼───────────┐                   │
│                    │   Docker Engine       │                   │
│                    │   data-root: NFS      │                   │
│                    └───────────────────────┘                   │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘
                                 │
                    ┌────────────▼────────────┐
                    │  NFS (192.168.1.10)     │
                    │  /mnt/stock_36to/data/  │
                    │  - docker/prod/         │
                    │  - docker/secrets/      │
                    └─────────────────────────┘

Fichiers de configuration

Côté projet (GitHub)

Côté serveur


Commandes de déploiement

Déployer un service

# Clone
git clone --branch main https://TOKEN@github.com/gouroubleu/hellocar.git /tmp/hellocar

# Build
cd /tmp/hellocar
docker build -f Dockerfile.{service} -t hellocar-{service}:prod .

# Run
docker run -d \
  --name hellocar-{service}-prod \
  --restart unless-stopped \
  -p {PORT}:{PORT} \
  -e NODE_ENV=production \
  -e ... \
  hellocar-{service}:prod

Redéployer un service

docker stop hellocar-{service}-prod
docker rm hellocar-{service}-prod
# Puis rebuild et run

Variables d'environnement

API (port 4510)

Public (port 4501)

Admin (port 4500)


Prochaines étapes