Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions .idea/amazonq.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/copilot.data.migration.ask2agent.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/flipkart.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:
mongo:
image: mongo:latest
ports:
- '27017:27017'
- '27017:27016'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== docker-compose mongo ports =="
rg -n "^\s*-\s*'?[0-9]+:[0-9]+'?" docker-compose.yml -C2

echo
echo "== mongo explicit port override in compose =="
rg -n -- "--port" docker-compose.yml || true

echo
echo "== DATABASE_URI values (if present) =="
rg -n "^DATABASE_URI=" .env .env.example 2>/dev/null || true

echo
echo "== app DB config usage =="
rg -n "mongooseAdapter|DATABASE_URI" src/payload/payload.config.ts -C2

Repository: adrianhajdin/ecommerce

Length of output: 1001


Fix reversed MongoDB port mapping on Line 21.

'27017:27016' maps host port 27017 to container port 27016, but MongoDB listens on 27017 by default. This mapping breaks host-to-container connectivity; the application's DATABASE_URI expects port 27017.

Proposed fix
   mongo:
     image: mongo:latest
     ports:
-      - '27017:27016'
+      - '27017:27017'

If you need to expose MongoDB on host port 27016, use '27016:27017' and update DATABASE_URI to mongodb://127.0.0.1:27016/....

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- '27017:27016'
- '27017:27017'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docker-compose.yml` at line 21, The port mapping string '27017:27016' in
docker-compose.yml is reversed; replace it so the container's MongoDB port 27017
is the right-hand side. Change '27017:27016' to either '27017:27017' to keep the
host using 27017 (so existing DATABASE_URI stays mongodb://127.0.0.1:27017/...)
or, if you intentionally want the host on 27016, change it to '27016:27017' and
update DATABASE_URI to mongodb://127.0.0.1:27016/... accordingly.

command:
- --storageEngine=wiredTiger
volumes:
Expand Down