summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorertopogo <erwin.t.pombett@gmail.com>2026-01-25 13:32:36 +0100
committerertopogo <erwin.t.pombett@gmail.com>2026-01-25 13:32:36 +0100
commitcae02f56ec6954d7737a83c46e27a8b0ff9fdf10 (patch)
tree3b362a325cafa194945055e7400b999dc1c4c0aa
parent5bba0aaf4a22c98aa637e464d41ddab326d9291c (diff)
chore: update docs and docker
-rw-r--r--app-management.md41
-rw-r--r--docker-compose.yml5
-rw-r--r--storefront/Dockerfile2
3 files changed, 46 insertions, 2 deletions
diff --git a/app-management.md b/app-management.md
index 233ec1f..1f9f326 100644
--- a/app-management.md
+++ b/app-management.md
@@ -108,9 +108,22 @@ sudo docker compose logs -f backend
curl -v http://localhost:9000/store/products
```
-- `curl -v` : verifie que l'API repond et montre les details de connexion.
+- `curl` : envoie une requete HTTP simple.
+- `-v` : mode verbeux (montre la requete, la reponse et les details reseau).
+- `http://localhost:9000/store/products` : endpoint public des produits.
- Si "connection reset by peer" -> le backend crash apres accept.
+### C.1) Test CORS (depuis le serveur)
+
+```
+curl -i -H "Origin: http://192.168.99.22:8000" http://192.168.99.22:9000/store/products
+```
+
+- `-i` : affiche les en-tetes HTTP de la reponse (utile pour CORS).
+- `-H "Origin: ..."` : simule l'origine du navigateur (storefront).
+- `http://192.168.99.22:9000/store/products` : endpoint backend teste.
+- Attendu : `Access-Control-Allow-Origin: http://192.168.99.22:8000`.
+
### D) Verifier la base (depuis un conteneur temporaire)
```
@@ -516,3 +529,29 @@ git push origin docs-git-dns
git stash pop
```
+### J) Pousser depuis antel puis recuperer sur huitral (branche main)
+
+Objectif : publier les changements faits sur antel, puis les recuperer sur huitral.
+
+Sur antel (branche `main`) :
+```
+git status
+git restore error_file_a.txt
+git add app-management.md docker-compose.yml storefront/Dockerfile
+git commit -m "chore: update docs and docker"
+git push origin main
+```
+
+- `restore error_file_a.txt` : retire un fichier local non souhaite.
+- `add ...` : commit uniquement les fichiers voulus (sans `.env`).
+
+Sur huitral (recuperer le dernier code) :
+```
+cd /var/www/lucien-sens-bon
+git fetch origin
+git checkout main
+git reset --hard origin/main
+```
+
+- `reset --hard` aligne strictement le code local sur la remote.
+
diff --git a/docker-compose.yml b/docker-compose.yml
index 775365f..a6daa82 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -21,7 +21,10 @@ services:
restart: always
storefront:
- build: ./storefront
+ build:
+ context: ./storefront
+ args:
+ - NEXT_PUBLIC_MEDUSA_BACKEND_URL=${NEXT_PUBLIC_MEDUSA_BACKEND_URL}
container_name: medusa-storefront
environment:
- NEXT_PUBLIC_MEDUSA_BACKEND_URL=${NEXT_PUBLIC_MEDUSA_BACKEND_URL}
diff --git a/storefront/Dockerfile b/storefront/Dockerfile
index b3f5cb8..5f1bd86 100644
--- a/storefront/Dockerfile
+++ b/storefront/Dockerfile
@@ -11,6 +11,8 @@ COPY --from=deps /app/node_modules ./node_modules
COPY . .
# Disable telemetry during build
ENV NEXT_TELEMETRY_DISABLED 1
+ARG NEXT_PUBLIC_MEDUSA_BACKEND_URL
+ENV NEXT_PUBLIC_MEDUSA_BACKEND_URL=$NEXT_PUBLIC_MEDUSA_BACKEND_URL
RUN npm run build
# Production image, copy all the files and run next