diff options
| author | ertopogo <erwin.t.pombett@gmail.com> | 2026-02-19 13:09:06 +0100 |
|---|---|---|
| committer | ertopogo <erwin.t.pombett@gmail.com> | 2026-02-19 13:09:06 +0100 |
| commit | 05825f1d7a26cafd5d897ce7abc09b50183cdef7 (patch) | |
| tree | 7c232fc81a0d42017bee615c276455aabbab0e1f | |
| parent | 77cb0486da9a0c454925f0f29b0c34c787a874e0 (diff) | |
fix: add .dockerignore, fix Dockerfile missing public dir, update DEPLOY.md paths
Co-authored-by: Cursor <cursoragent@cursor.com>
| -rw-r--r-- | .dockerignore | 5 | ||||
| -rw-r--r-- | DEPLOY.md | 38 | ||||
| -rw-r--r-- | Dockerfile | 1 | ||||
| -rw-r--r-- | public/favicon.ico | 0 |
4 files changed, 24 insertions, 20 deletions
diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f15a041 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +node_modules +.next +.git +.env*.local +media @@ -28,15 +28,15 @@ huitral (Docker Compose) ```bash ssh toshiro@chillka -# Creer le repertoire pour les repos (une seule fois) -mkdir -p ~/git -cd ~/git +# Creer le repertoire pour les repos (une seule fois, peut necesiter sudo) +sudo mkdir -p /var/data/git/repositories +sudo chown toshiro:toshiro /var/data/git/repositories # Creer le bare repo -git init --bare der-topogo.git +git init --bare /var/data/git/repositories/der-topogo.git # Ajouter une description (optionnel) -echo "Site consulting IAM & Securite - Der-topogo" > ~/git/der-topogo.git/description +echo "Site consulting IAM & Securite - Der-topogo" > /var/data/git/repositories/der-topogo.git/description exit ``` @@ -49,7 +49,7 @@ Depuis le poste de developpement Windows : cd e:\Dev\Web-Works\Der-topogo # Ajouter chillka comme remote "origin" -git remote add origin toshiro@chillka:git/der-topogo.git +git remote add origin toshiro@chillka:/var/data/git/repositories/der-topogo.git # Pousser le code (premier push) git push -u origin main @@ -68,12 +68,10 @@ ssh toshiro@huitral docker --version docker compose version -# Creer le dossier applicatif -mkdir -p ~/apps -cd ~/apps - -# Cloner le repo depuis chillka -git clone toshiro@chillka:git/der-topogo.git +# Cloner le repo dans /var/www/ (standard FHS pour les sites web) +cd /var/www +sudo git clone toshiro@chillka:/var/data/git/repositories/der-topogo.git +sudo chown -R toshiro:toshiro der-topogo cd der-topogo ``` @@ -163,7 +161,7 @@ Puis sur huitral : ```bash ssh toshiro@huitral -cd ~/apps/der-topogo +cd /var/www/der-topogo git pull origin main docker compose up -d --build ``` @@ -174,7 +172,7 @@ Si le build prend du temps et que vous voulez minimiser le downtime : ```bash ssh toshiro@huitral -cd ~/apps/der-topogo +cd /var/www/der-topogo git pull origin main # Construire la nouvelle image sans arreter les services @@ -212,20 +210,20 @@ ssh-copy-id toshiro@huitral ```bash ssh toshiro@chillka -cat > ~/git/der-topogo.git/hooks/post-receive << 'HOOK' +cat > /var/data/git/repositories/der-topogo.git/hooks/post-receive << 'HOOK' #!/bin/bash BRANCH=$(git rev-parse --symbolic --abbrev-ref $3) if [ "$BRANCH" = "main" ]; then echo "==> Push on main detected, deploying to huitral..." - ssh toshiro@huitral "cd ~/apps/der-topogo && git pull origin main && docker compose up -d --build" + ssh toshiro@huitral "cd /var/www/der-topogo && git pull origin main && docker compose up -d --build" echo "==> Deploy complete." else echo "==> Push on branch $BRANCH, skipping deploy." fi HOOK -chmod +x ~/git/der-topogo.git/hooks/post-receive +chmod +x /var/data/git/repositories/der-topogo.git/hooks/post-receive exit ``` @@ -239,7 +237,7 @@ Desormais, chaque `git push origin main` depuis le poste de dev deploiera automa ```bash ssh toshiro@huitral -cd ~/apps/der-topogo +cd /var/www/der-topogo # Voir les derniers commits git log --oneline -10 @@ -343,7 +341,7 @@ Pour connecter le site a votre Keycloak existant, creer un client OIDC dans votr | Serveur | Role | Acces | |---|---|---| -| **chillka** | Repo Git (bare) | `toshiro@chillka:git/der-topogo.git` | -| **huitral** | Hebergement Docker | `toshiro@huitral` (apps dans `~/apps/der-topogo`) | +| **chillka** | Repo Git (bare) | `toshiro@chillka:/var/data/git/repositories/der-topogo.git` | +| **huitral** | Hebergement Docker | `toshiro@huitral` (site dans `/var/www/der-topogo`) | | **npagnun** | Keycloak (IdP OIDC) | Console admin Keycloak | | **PostgreSQL** | Base de donnees | Connexion via `DATABASE_URI` | @@ -24,6 +24,7 @@ ENV NEXT_TELEMETRY_DISABLED=1 RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs +RUN mkdir -p ./public COPY --from=builder /app/public ./public COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/public/favicon.ico |
