-
Notifications
You must be signed in to change notification settings - Fork 71
Update docker-compose.yml #1529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- update master-table.json path - add volume to store bulk issuance files Signed-off-by: Sahil Kamble <[email protected]>
WalkthroughUpdated Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docker-compose.yml(3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-17T08:03:16.180Z
Learnt from: KambleSahil3
Repo: credebl/platform PR: 1518
File: libs/prisma-service/prisma/data/credebl-master-table/credebl-master-table.json:11-20
Timestamp: 2025-11-17T08:03:16.180Z
Learning: In the credebl/platform repository, seed data files like libs/prisma-service/prisma/data/credebl-master-table/credebl-master-table.json intentionally contain empty strings for sensitive fields (email, username, passwords, API keys, etc.) because these values are populated from .env file at runtime, not hardcoded in the JSON.
Applied to files:
docker-compose.yml
🔇 Additional comments (1)
docker-compose.yml (1)
28-28: The docker-compose volume mount is misconfigured and will cause the seed service to fail at runtime.The seed service code (
libs/prisma-service/prisma/seed.ts) expects to read fromprisma/data/credebl-master-table/credebl-master-table.json(nested directory structure), but the volume mount in docker-compose only mounts the flat file itself, not the directory containing it.Current mount (broken):
- $PWD/libs/prisma-service/prisma/data/credebl-master-table.json:/app/libs/prisma-service/prisma/data/credebl-master-table.jsonRequired mount (to match seed.ts expectation):
- $PWD/libs/prisma-service/prisma/data/credebl-master-table:/app/libs/prisma-service/prisma/data/credebl-master-tableThe mount must include the parent directory (
credebl-master-table/) rather than just the JSON file, so the nested structurecredebl-master-table/credebl-master-table.jsonis accessible to the seed service inside the container.⛔ Skipped due to learnings
Learnt from: KambleSahil3 Repo: credebl/platform PR: 1518 File: libs/prisma-service/prisma/data/credebl-master-table/credebl-master-table.json:11-20 Timestamp: 2025-11-17T08:03:16.180Z Learning: In the credebl/platform repository, seed data files like libs/prisma-service/prisma/data/credebl-master-table/credebl-master-table.json intentionally contain empty strings for sensitive fields (email, username, passwords, API keys, etc.) because these values are populated from .env file at runtime, not hardcoded in the JSON.
| volumes: | ||
| - $PWD/apps/uploadedFiles/exports:/app/uploadedFiles/exports |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Verify issuance service configuration for the exports directory
# Check if the uploadedFiles/exports directory exists in the repo
if [ -d "apps/uploadedFiles/exports" ]; then
echo "✓ Directory exists at apps/uploadedFiles/exports"
ls -la apps/uploadedFiles/exports
else
echo "ℹ Directory does not yet exist at apps/uploadedFiles/exports (may be created at runtime)"
fi
# Search for references to uploadedFiles/exports in issuance service code
echo -e "\n=== Checking for exports directory references in issuance service ==="
rg -i 'uploadedFiles.*exports|exports.*directory' apps/issuance --type=ts --type=js -C 2 2>/dev/null || echo "No matches found in issuance service"
# Search for related file upload/export handling patterns
echo -e "\n=== Checking for file export patterns in issuance service ==="
rg -i 'export.*file|bulk.*issuance' apps/issuance --type=ts --type=js -C 1 2>/dev/null | head -15Repository: credebl/platform
Length of output: 1810
🏁 Script executed:
#!/bin/bash
# Find and examine the createFile function
echo "=== Looking for createFile function definition ==="
rg -n 'function createFile|export.*createFile|const createFile' apps/issuance --type=ts --type=js -A 10 | head -30
# Check for any mkdir or directory creation in issuance service
echo -e "\n=== Checking for directory creation logic in issuance service ==="
rg -n 'mkdir|createDir|ensureDir|existsSync|makedirs' apps/issuance --type=ts --type=js -B 2 -A 2
# Look at the full docker-compose.yml context
echo -e "\n=== Checking docker-compose.yml for issuance service context ==="
cat -n docker-compose.yml | sed -n '60,85p'
# Check if there's a Dockerfile or entrypoint script for issuance
echo -e "\n=== Looking for Dockerfile or initialization scripts ==="
find apps/issuance -name "Dockerfile*" -o -name "entrypoint*" -o -name "*.sh" | head -10Repository: credebl/platform
Length of output: 1038
🏁 Script executed:
#!/bin/bash
# Get the full issuance service configuration from docker-compose
echo "=== Full issuance service in docker-compose.yml ==="
rg -n 'issuance:' docker-compose.yml -A 20
# Search for createFile across entire repository
echo -e "\n=== Searching for createFile function across repo ==="
rg -n 'export.*createFile|function createFile|const createFile' . --type=ts --type=js | head -20
# Search more broadly for file creation utilities
echo -e "\n=== Searching for file utility functions ==="
rg -n 'createFile|writeFile|ensureFile' . --type=ts --type=js --glob='**/util*' --glob='**/lib*' --glob='**/helper*' -l
# Check docker-compose structure - get lines around the volume mount mentioned
echo -e "\n=== Checking docker-compose.yml structure around uploads/exports ==="
rg -n 'uploadedFiles.*exports|/app/uploadedFiles/exports' docker-compose.yml -B 5 -A 2Repository: credebl/platform
Length of output: 1054
🏁 Script executed:
#!/bin/bash
# Read the createFile function implementation
echo "=== Reading createFile function from file-operation.helper.ts ==="
cat -n apps/api-gateway/src/helper-files/file-operation.helper.ts
# Also check if there are any imports or usages related to mkdir
echo -e "\n=== Checking for mkdir or fs-extra usage in file-operation.helper.ts ==="
rg -n 'mkdir|ensureDir|mkdirSync|promises\.mkdir' apps/api-gateway/src/helper-files/file-operation.helper.ts -B 2 -A 2Repository: credebl/platform
Length of output: 1614
🏁 Script executed:
#!/bin/bash
# Search for any .gitkeep or placeholder files
echo "=== Looking for uploadedFiles directory structure ==="
find . -path "*/uploadedFiles*" -type f -o -path "*/uploadedFiles*" -type d 2>/dev/null | head -20
# Check if there's a Dockerfile for issuance service that sets working directory
echo -e "\n=== Searching for Dockerfile or build configuration ==="
find . -name "Dockerfile*" -o -name ".dockerignore" | xargs grep -l "issuance\|WORKDIR" 2>/dev/null | head -10
# Verify the actual paths used in issuance service
echo -e "\n=== Checking all uploadedFiles references in issuance service ==="
rg -n 'uploadedFiles' apps/issuance --type=ts --type=js -B 2 -A 2
# Check if process.cwd() is being used elsewhere to understand container context
echo -e "\n=== Checking process.cwd() usage ==="
rg -n 'process\.cwd()' apps/issuance --type=ts --type=js -C 1 | head -20Repository: credebl/platform
Length of output: 1906
🏁 Script executed:
#!/bin/bash
# Read the Dockerfile for issuance service
echo "=== Dockerfile.issuance ==="
cat -n Dockerfiles/Dockerfile.issuance
# Also check for any docker-compose overrides or additional config
echo -e "\n=== Checking if there are docker-compose overrides or extended configs ==="
find . -name "docker-compose*.yml" -o -name "docker-compose*.yaml" | head -10Repository: credebl/platform
Length of output: 1964
🏁 Script executed:
#!/bin/bash
# Get the full docker-compose.yml to see actual structure
echo "=== Full docker-compose.yml issuance service section ==="
rg -n 'issuance:' docker-compose.yml -A 30
# Check for any volume definitions at service or compose level
echo -e "\n=== Checking volumes section in docker-compose.yml ==="
rg -n 'volumes:' docker-compose.yml -A 10
# Double-check current line 71-72 context from the file
echo -e "\n=== Exact lines 71-72 from docker-compose.yml ==="
sed -n '69,75p' docker-compose.ymlRepository: credebl/platform
Length of output: 2883
🏁 Script executed:
#!/bin/bash
# Check Node.js version to confirm mkdirSync behavior
echo "=== Confirming mkdirSync recursive flag requirement ==="
grep -i "node:" Dockerfiles/Dockerfile.issuance | head -1
# Search for any recent updates to the file-operation helper (in case recursive flag was added)
echo -e "\n=== Double-checking current createFile implementation ==="
rg -n 'mkdirSync' apps/api-gateway/src/helper-files/file-operation.helper.ts
# Check if there's a .gitkeep in uploadedFiles or any placeholder
echo -e "\n=== Looking for any gitkeep or init files ==="
find . -name ".gitkeep" -path "*uploadedFiles*" -o -name "README*" -path "*uploadedFiles*" 2>/dev/nullRepository: credebl/platform
Length of output: 279
Based on my comprehensive verification, I've identified several critical issues with the proposed volume mount configuration. Here's the rewritten review comment:
Fix critical directory creation bug and ensure host directory exists before deployment.
The proposed volume mount ($PWD/apps/uploadedFiles/exports:/app/uploadedFiles/exports) references a path that will fail at runtime due to a bug in the createFile utility. The function at apps/api-gateway/src/helper-files/file-operation.helper.ts:13 uses fs.mkdirSync(path) without the { recursive: true } flag, which will fail when creating nested directories like uploadedFiles/exports.
Additionally:
- The host directory
apps/uploadedFiles/exportsdoes not exist in the repository (no.gitkeepor placeholder), and Docker volume mounts do not auto-create host directories - The Dockerfile does not initialize this directory (line 42 that would copy it is commented out)
- File permissions and ownership are not specified in the volume mount configuration
Required fixes:
- Update
createFileinapps/api-gateway/src/helper-files/file-operation.helper.tsto usefs.mkdirSync(path, { recursive: true }) - Add
.gitkeeptoapps/uploadedFiles/exportsor ensure directory creation during deployment - Consider specifying permissions via uid:gid in the docker-compose volume mount if needed
🤖 Prompt for AI Agents
In docker-compose.yml around lines 71-72, the volume mount
$PWD/apps/uploadedFiles/exports:/app/uploadedFiles/exports will fail because the
host path may not exist and your createFile utility in
apps/api-gateway/src/helper-files/file-operation.helper.ts (around line 13) uses
fs.mkdirSync(path) without recursive=true; update that function to call
fs.mkdirSync(path, { recursive: true }) so nested dirs are created, add a
placeholder (e.g., .gitkeep) or ensure the directory apps/uploadedFiles/exports
is created prior to Docker up (CI/build script or repo) so the host path exists,
and if needed adjust the docker-compose volume to include explicit uid:gid
permissions or set proper chown in the container startup to avoid permission
issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KambleSahil3 Please add the folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!



Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.