Dokploy - Plateforme de Déploiement Self-Hosted
Vue d’ensemble
Section intitulée « Vue d’ensemble »On ne fait pas de l’approximatif ici. L’objectif est de garantir que n’importe quel dev de l’équipe puisse monter un environnement Dokploy en local, en HTTPS, sur une stack ISO-Prod, en moins de 10 minutes.
Dokploy est une alternative open-source et self-hosted à Vercel/Heroku. Il permet de déployer des applications via Docker Compose avec un reverse proxy Traefik intégré, le tout managé via une interface web.
Pourquoi Dokploy ?
Section intitulée « Pourquoi Dokploy ? »| Critère | Dokploy | Alternatives Cloud |
|---|---|---|
| Souveraineté | Données on-premise | Données chez le provider |
| Coût | Gratuit (self-hosted) | Pay-per-use |
| Contrôle | Total | Limité |
| Conformité | RGPD natif | Dépend du provider |
Architecture cible
Section intitulée « Architecture cible »graph TB subgraph HOST["Machine Hôte (Windows)"] subgraph WSL["WSL2"] VAGRANT[Vagrant CLI] MKCERT[mkcert] GIT[Git] end subgraph VMWARE["VMware Workstation"] subgraph VM["Ubuntu 22.04 VM
192.168.56.10"] BIND9["bind9
DNS :53"] DOKPLOY["Dokploy
:3000"] TRAEFIK["Traefik
:80/:443"] APPS[Applications] end end end VAGRANT -->|"vagrant up"|VM BIND9 -.->|"résolution DNS"|TRAEFIK DOKPLOY -->|"configure"|TRAEFIK TRAEFIK -->|"route"|APPS style HOST fill:#1a1a2e,stroke:#16213e,color:#fff style WSL fill:#0f3460,stroke:#16213e,color:#fff style VMWARE fill:#533483,stroke:#16213e,color:#fff style VM fill:#e94560,stroke:#16213e,color:#fff style BIND9 fill:#ff6f00,stroke:#16213e,color:#fff style DOKPLOY fill:#00c853,stroke:#16213e,color:#fff style TRAEFIK fill:#2196f3,stroke:#16213e,color:#fff style APPS fill:#9c27b0,stroke:#16213e,color:#fff
1. Prérequis
Section intitulée « 1. Prérequis »Avant de continuer, assurez-vous d’avoir configuré :
| Composant | Documentation | Status |
|---|---|---|
| Vagrant + VMware | vagrant-vmware.md | Requis |
| bind9 + mkcert | dns-ssl-local.md | Requis |
Vagrantfile complet (avec Dokploy + bind9)
Section intitulée « Vagrantfile complet (avec Dokploy + bind9) »# -*- mode: ruby -*-# vi: set ft=ruby :
Vagrant.configure("2") do |config| config.vm.box = "bento/ubuntu-22.04"
config.vm.provider "vmware_desktop" do |v| v.gui = false v.allowlist_verified = true v.vmx["memsize"] = "4096" v.vmx["numvcpus"] = "2" v.vmx["displayName"] = "KDS-Dokploy-Local" end
config.vm.network "private_network", ip: "192.168.56.10" config.vm.hostname = "kds-dokploy-local"
config.vm.provision "shell", inline: <<-SHELL export DEBIAN_FRONTEND=noninteractive
apt-get update && apt-get install -y \ curl git apt-transport-https ca-certificates \ software-properties-common gnupg lsb-release \ bind9 bind9utils bind9-doc
# Configuration bind9 (voir dns-ssl-local.md) mkdir -p /etc/bind/zones cat > /etc/bind/zones/db.domaine.local << 'EOF'$TTL 604800@ IN SOA ns1.domaine.local. admin.domaine.local. ( 2024120701 604800 86400 2419200 604800 )@ IN NS ns1.domaine.local.@ IN A 192.168.56.10ns1 IN A 192.168.56.10* IN A 192.168.56.10EOF
cat >> /etc/bind/named.conf.local << 'EOF'zone "domaine.local" { type master; file "/etc/bind/zones/db.domaine.local";};EOF
sed -i 's/listen-on-v6 { any; };/listen-on-v6 { none; };/' /etc/bind/named.conf.options sed -i '/directory/a\\tallow-query { any; };' /etc/bind/named.conf.options sed -i '/directory/a\\tlisten-on { 192.168.56.10; 127.0.0.1; };' /etc/bind/named.conf.options
named-checkconf && named-checkzone domaine.local /etc/bind/zones/db.domaine.local systemctl enable bind9 && systemctl restart bind9
# Docker curl -fsSL https://get.docker.com | sh usermod -aG docker vagrant systemctl enable docker && systemctl start docker
# Dokploy curl -sSL https://dokploy.com/install.sh | sh
echo ">>> DNS: 192.168.56.10 | Dokploy: http://192.168.56.10:3000" SHELLendDémarrage :
vagrant up2. Configuration Dokploy
Section intitulée « 2. Configuration Dokploy »2.1 Premier accès
Section intitulée « 2.1 Premier accès »- Ouvrez
http://192.168.56.10:3000 - Créez le compte administrateur (email + mot de passe fort)
- Connectez-vous à l’interface
2.2 Injection du certificat SSL
Section intitulée « 2.2 Injection du certificat SSL »Générez d’abord vos certificats avec mkcert (voir DNS & SSL Local) :
mkdir -p certs && cd certsmkcert -key-file key.pem -cert-file cert.pem domaine.local "*.domaine.local"Puis dans Dokploy :
- Allez dans Settings > Certificates
- Cliquez sur Add New Certificate
- Remplissez le formulaire :
| Champ | Valeur |
|---|---|
| Certificate Name | KDS Local Wildcard |
| Certificate Data | Contenu de cert.pem |
| Private Key | Contenu de key.pem |
Récupérer le contenu :
cat certs/cert.pemcat certs/key.pem2.3 Configuration du domaine
Section intitulée « 2.3 Configuration du domaine »Dans Settings > Server :
| Paramètre | Valeur |
|---|---|
| Server Domain | domaine.local |
| Let’s Encrypt Email | (vide en local) |
3. Déploiement d’une Application
Section intitulée « 3. Déploiement d’une Application »Exemple : KDS-RH CV Analyzer
Section intitulée « Exemple : KDS-RH CV Analyzer »3.1 Architecture
Section intitulée « 3.1 Architecture »graph TB CLIENT[Client HTTPS] --> TRAEFIK["Traefik
(Dokploy)"] TRAEFIK --> BACKEND["Backend
(Flask)"] BACKEND --> REDIS[Redis] BACKEND --> OLLAMA["Ollama
(host)"] style CLIENT fill:#4285f4,stroke:#16213e,color:#fff style TRAEFIK fill:#e94560,stroke:#16213e,color:#fff style BACKEND fill:#00c853,stroke:#16213e,color:#fff style REDIS fill:#ff6f00,stroke:#16213e,color:#fff style OLLAMA fill:#9c27b0,stroke:#16213e,color:#fff
3.2 Créer le projet
Section intitulée « 3.2 Créer le projet »- Dans Dokploy : Projects > Create Project
- Nom :
KDS-RH - Add Service > Compose
- Source : Git Repository
- URL :
https://git.kodetis.io/kds-rh/cv-analyzer.git - Branch :
main
- URL :
3.3 Docker Compose de production
Section intitulée « 3.3 Docker Compose de production »services: backend: build: context: . dockerfile: Dockerfile container_name: kds-rh-backend restart: unless-stopped environment: - FLASK_ENV=production - FLASK_DEBUG=0 - ALLOWED_ORIGINS=https://cv.domaine.local - OLLAMA_HOST=${OLLAMA_HOST:-http://host.docker.internal:11434} - REDIS_URL=redis://redis:6379/0 - LOGS_ACCESS_TOKEN=${LOGS_ACCESS_TOKEN} depends_on: redis: condition: service_healthy healthcheck: test: ["CMD", "curl", "-f", "http://localhost:5001/health"] interval: 30s timeout: 10s retries: 3 start_period: 40s networks: - dokploy-network - internal labels: - "traefik.enable=true" - "traefik.http.routers.kdsrh-backend.rule=Host(`cv.domaine.local`)" - "traefik.http.routers.kdsrh-backend.entrypoints=websecure" - "traefik.http.routers.kdsrh-backend.tls=true" - "traefik.http.services.kdsrh-backend.loadbalancer.server.port=5001" - "traefik.docker.network=dokploy-network"
redis: image: redis:7-alpine container_name: kds-rh-redis restart: unless-stopped volumes: - redis_data:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 5 networks: - internal
volumes: redis_data:
networks: dokploy-network: external: true internal: driver: bridge3.4 Variables d’environnement
Section intitulée « 3.4 Variables d’environnement »Dans l’onglet Environment de Dokploy :
| Variable | Valeur | Description |
|---|---|---|
FLASK_ENV | production | Mode production |
FLASK_DEBUG | 0 | Debug désactivé |
ALLOWED_ORIGINS | https://cv.domaine.local | CORS |
OLLAMA_HOST | http://host.docker.internal:11434 | URL Ollama |
LOGS_ACCESS_TOKEN | <token> | Accès logs |
Générer un token :
openssl rand -hex 323.5 Déployer
Section intitulée « 3.5 Déployer »- Cliquez sur Deploy
- Suivez les logs de build
- Vérifiez l’état :
https://cv.domaine.local
4. Configuration Ollama (LLM)
Section intitulée « 4. Configuration Ollama (LLM) »L’application CV Analyzer nécessite Ollama avec le modèle gpt-oss:30b-32k. Pour l’installation et la configuration d’Ollama, voir Configurer son Espace de Travail.
5. Vérification
Section intitulée « 5. Vérification »Endpoints de diagnostic
Section intitulée « Endpoints de diagnostic »| Endpoint | Description | Auth |
|---|---|---|
GET /health | Healthcheck | Non |
GET /nova-status | Statut Nova | Non |
GET /logs?lines=N | Logs | Token |
# Santécurl -k https://cv.domaine.local/health
# Nova Frameworkcurl -k https://cv.domaine.local/nova-status
# Logs (avec token)curl -k -H "Authorization: Bearer <TOKEN>" \ "https://cv.domaine.local/logs?lines=50"
# Test analyse CVcurl -k -X POST https://cv.domaine.local/compare \ -F "cv=@cv.pdf" \ -F "offer_url=https://kodetis.com/offre"6. Troubleshooting
Section intitulée « 6. Troubleshooting »Dokploy inaccessible
Section intitulée « Dokploy inaccessible »vagrant sshdocker ps | grep dokploydocker logs dokploy -fApplication non routée
Section intitulée « Application non routée »# Vérifier les labels Traefikdocker inspect kds-rh-backend | grep -A 20 Labels
# Logs Traefikdocker logs $(docker ps -q -f name=traefik) -fRedis non connecté
Section intitulée « Redis non connecté »docker exec -it kds-rh-redis redis-cli ping# PONGOllama non accessible
Section intitulée « Ollama non accessible »curl http://localhost:11434/api/tags
# Depuis Docker, utiliser :# OLLAMA_HOST=http://host.docker.internal:11434Rebuild complet
Section intitulée « Rebuild complet »vagrant sshdocker builder prune -f
# Dans Dokploy : Rebuild > Force rebuild7. Résumé des commandes
Section intitulée « 7. Résumé des commandes »| Action | Commande |
|---|---|
| VM : Démarrer | vagrant up |
| VM : SSH | vagrant ssh |
| VM : Arrêter | vagrant halt |
| DNS : Test | nslookup cv.domaine.local 192.168.56.10 |
| Certs : Générer | mkcert -key-file key.pem -cert-file cert.pem domaine.local "*.domaine.local" |
| Dokploy : UI | http://192.168.56.10:3000 |
| App : Health | curl -k https://cv.domaine.local/health |
| Token | openssl rand -hex 32 |
8. Ressources
Section intitulée « 8. Ressources »Documentation
Section intitulée « Documentation »Guides liés
Section intitulée « Guides liés »Repos KDS
Section intitulée « Repos KDS »Dernière mise à jour : 2025-12-07