fix(ci): use --network host for Mongo + add diagnostics
Wait-for-Mongo timed out at 30s after Start-MongoDB succeeded — typical Docker-in-Docker symptom where -p port mapping binds to a network the runner's node process can't see. --network host puts Mongo in the runner's network namespace so localhost:27017 reaches it. Also dump 'docker ps' after start and 'docker logs mongo-ci' on failure so the next-step debugging isn't blind.
This commit is contained in:
parent
a797f8e17c
commit
386cb7e4b2
1 changed files with 12 additions and 2 deletions
|
|
@ -39,9 +39,14 @@ jobs:
|
|||
- run: npm ci
|
||||
- run: npx playwright install --with-deps chromium
|
||||
- name: Start MongoDB
|
||||
run: docker run -d --name mongo-ci -p 27017:27017 mongo:7
|
||||
run: |
|
||||
docker run -d --name mongo-ci --network host mongo:7
|
||||
docker ps
|
||||
- name: Wait for MongoDB
|
||||
run: timeout 30 sh -c 'until nc -z localhost 27017; do sleep 1; done'
|
||||
- name: MongoDB log on failure
|
||||
if: failure()
|
||||
run: docker logs mongo-ci || true
|
||||
- run: npm run build
|
||||
- name: Start server
|
||||
run: node .output/server/index.mjs > /tmp/server.log 2>&1 &
|
||||
|
|
@ -96,9 +101,14 @@ jobs:
|
|||
- run: npm ci
|
||||
- run: npx playwright install --with-deps chromium
|
||||
- name: Start MongoDB
|
||||
run: docker run -d --name mongo-ci -p 27017:27017 mongo:7
|
||||
run: |
|
||||
docker run -d --name mongo-ci --network host mongo:7
|
||||
docker ps
|
||||
- name: Wait for MongoDB
|
||||
run: timeout 30 sh -c 'until nc -z localhost 27017; do sleep 1; done'
|
||||
- name: MongoDB log on failure
|
||||
if: failure()
|
||||
run: docker logs mongo-ci || true
|
||||
- run: npm run build
|
||||
- name: Start server
|
||||
run: node .output/server/index.mjs > /tmp/server.log 2>&1 &
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue