-
Notifications
You must be signed in to change notification settings - Fork 10
Issue #245978 feat: Provider BE - Docker Security Hotspot fixes #131
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
Open
rajnishdargan
wants to merge
9
commits into
PSMRI:main
Choose a base branch
from
rajnishdargan:security-fixes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c19f2b3
Issue #245978 feat: Provider BE - Security Hotspot fixes
rajnishdargan 97c6215
Issue #245978 feat: Provider BE - Security Hotspot fixes
rajnishdargan 0fb24fa
Issue #245978 feat: Provider BE - Security Hotspot fixes
rajnishdargan c7c3812
Issue #245978 feat: Fix coderabbit issues
rajnishdargan 21750a5
Issue #245978 feat: Fix coderabbit issues
rajnishdargan 314d83a
Issue #245978 feat: Fix coderabbit issues
rajnishdargan 626571f
Issue #245978 feat: Fix coderabbit issues
rajnishdargan b92af66
Issue #245978 feat: Fix sonar issues
rajnishdargan fa8b38e
Issue #245978 feat: Fix code rabbit issues
rajnishdargan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| # Dependencies | ||
| node_modules | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
|
|
||
| # Environment files | ||
| .env | ||
| .env.local | ||
| .env.development.local | ||
| .env.test.local | ||
| .env.production.local | ||
| *.env | ||
| .npmrc | ||
| .yarnrc | ||
| .pnpmrc | ||
|
|
||
| # Git | ||
| .git | ||
| .gitignore | ||
| .gitattributes | ||
|
|
||
| # Documentation | ||
| README.md | ||
| CHANGELOG.md | ||
| *.md | ||
| docs/ | ||
|
|
||
| # Tests | ||
| test/ | ||
| tests/ | ||
| __tests__/ | ||
| *.test.js | ||
| *.spec.js | ||
| coverage/ | ||
|
|
||
| # IDE and editor files | ||
| .vscode/ | ||
| .idea/ | ||
| *.swp | ||
| *.swo | ||
| *~ | ||
|
|
||
| # OS generated files | ||
| .DS_Store | ||
| .DS_Store? | ||
| ._* | ||
| .Spotlight-V100 | ||
| .Trashes | ||
| ehthumbs.db | ||
| Thumbs.db | ||
|
|
||
| # Logs | ||
| logs/ | ||
| *.log | ||
|
|
||
| # Docker files | ||
| Dockerfile* | ||
| docker-compose*.yml | ||
| .dockerignore | ||
|
|
||
| # Build artifacts | ||
| dist/ | ||
| build/ | ||
| .next/ | ||
| .nuxt/ | ||
|
|
||
| # Temporary files | ||
| tmp/ | ||
| temp/ | ||
|
|
||
| # Miscellaneous | ||
| .nyc_output | ||
| .cache | ||
| .parcel-cache | ||
| .tsbuildinfo | ||
| *.tsbuildinfo | ||
|
|
||
| # Keys/credentials | ||
| *.pem | ||
| *.key | ||
| *.p12 | ||
| *.pfx | ||
| *.crt | ||
| id_rsa* | ||
| id_ed25519* | ||
| .ssh/ | ||
|
|
||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # Scripts (excluding from production) | ||
| scripts/ | ||
|
|
||
| # Mock files | ||
| mock-files/ | ||
|
|
||
| # Upload files (sensitive data) | ||
| uploads/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,29 @@ | ||
| FROM node:20 as dependencies | ||
|
|
||
| FROM node:20-alpine AS builder | ||
| RUN apk add --no-cache g++ libc6-compat make python3 | ||
| WORKDIR /app | ||
|
|
||
| # Install dependencies | ||
| COPY package*.json ./ | ||
| RUN npm install | ||
|
|
||
| # Copy everything else (including prisma/) | ||
| COPY . . | ||
|
|
||
| # Optional check to confirm schema exists | ||
| RUN ls -la prisma/schema.prisma | ||
|
|
||
| # Generate Prisma client | ||
| RUN npx prisma generate | ||
|
|
||
| # Run migrations | ||
| #RUN npx prisma migrate dev --name init | ||
| #RUN npx prisma migrate reset --force | ||
|
|
||
| # Build project | ||
| RUN npm run build | ||
|
|
||
| RUN npm ci --ignore-scripts | ||
| COPY prisma/ ./prisma/ | ||
| COPY src/ ./src/ | ||
| COPY nest-cli.json ./ | ||
| COPY tsconfig*.json ./ | ||
| COPY eslint.config.mjs ./ | ||
| RUN npx prisma generate && npm run build | ||
|
|
||
| FROM node:20-alpine AS runner | ||
| ENV NODE_ENV=production | ||
| # Create app user/group | ||
| RUN addgroup -g 1001 -S appgroup && adduser -S appuser -u 1001 -G appgroup -s /sbin/nologin -h /home/appuser | ||
| WORKDIR /app | ||
| COPY --chown=root:appgroup package*.json ./ | ||
| RUN chmod 644 package*.json && npm ci --omit=dev --ignore-scripts && npm cache clean --force | ||
| # Copy only runtime artifacts | ||
| COPY --chown=root:appgroup prisma/ ./prisma/ | ||
| COPY --from=builder --chown=root:appgroup /app/dist/ ./dist/ | ||
| COPY --from=builder --chown=root:appgroup /app/node_modules/.prisma/ ./node_modules/.prisma/ | ||
| RUN chmod -R 644 prisma/ dist/ node_modules/.prisma/ && \ | ||
| find prisma/ dist/ node_modules/.prisma/ -type d -exec chmod 755 {} \; && \ | ||
| mkdir -p /app/logs /app/temp && chown appuser:appgroup /app/logs /app/temp && chmod 755 /app/logs /app/temp | ||
| USER appuser | ||
| EXPOSE 7000 | ||
|
|
||
| CMD ["npm", "start"] | ||
| CMD ["node", "dist/main.js"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.