Fix port conflict: use port 27018 for test MongoDB
Host machine already has MongoDB on 27017, so map the test container to 27018 instead to avoid port allocation conflict.
This commit is contained in:
4
.github/workflows/deploy.yml
vendored
4
.github/workflows/deploy.yml
vendored
@ -23,7 +23,7 @@ jobs:
|
||||
mongodb:
|
||||
image: mongo:7
|
||||
ports:
|
||||
- 27017:27017
|
||||
- 27018:27017
|
||||
options: >-
|
||||
--health-cmd "mongosh --eval 'db.runCommand(\"ping\").ok'"
|
||||
--health-interval 10s
|
||||
@ -46,7 +46,7 @@ jobs:
|
||||
- name: Run tests
|
||||
run: npm test -- --runInBand
|
||||
env:
|
||||
MONGO_URI: mongodb://localhost:27017
|
||||
MONGO_URI: mongodb://localhost:27018
|
||||
JWT_SECRET: test-jwt-secret-for-ci
|
||||
NODE_ENV: test
|
||||
|
||||
|
||||
Reference in New Issue
Block a user