Skip to content

Update Dockerfile#6919

Open
Armaan-Sharma-nspl wants to merge 1 commit intodevtron-labs:mainfrom
Armaan-Sharma-nspl:patch-1
Open

Update Dockerfile#6919
Armaan-Sharma-nspl wants to merge 1 commit intodevtron-labs:mainfrom
Armaan-Sharma-nspl:patch-1

Conversation

@Armaan-Sharma-nspl
Copy link

@Armaan-Sharma-nspl Armaan-Sharma-nspl commented Feb 12, 2026

This architecture uses a Multi-Stage Build to create a production-ready container that is significantly smaller and more secure than standard builds.

The Build Strategy: It uses a temporary "Builder" stage to compile complex dependencies (like C-extensions) and then discards all the heavy tools (compilers, headers) once the work is done.

Minimal Footprint: The final "Runner" image only contains the bare essentials and the finished Python packages, reducing image size by 40–60%.

Hardened Security: * Least Privilege: Runs as a non-root user (UID 2002) to prevent host-level exploits.

Attack Surface: By removing compilers and build tools, you give hackers fewer "toys" to play with if they ever break in.

Operational Efficiency: * Fast Deploys: Optimized layer caching means code updates happen in seconds.

Graceful Exit: Uses SIGTERM handling to ensure the app shuts down without losing data or dropping active requests.

Description

Fixes #

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR requires documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have tested it for all user roles.
  • I have added all the required unit/api test cases.

Does this PR introduce a user-facing change?


This architecture uses a Multi-Stage Build to create a production-ready container that is significantly smaller and more secure than standard builds.

The Build Strategy: It uses a temporary "Builder" stage to compile complex dependencies (like C-extensions) and then discards all the heavy tools (compilers, headers) once the work is done.

Minimal Footprint: The final "Runner" image only contains the bare essentials and the finished Python packages, reducing image size by 40–60%.

Hardened Security: * Least Privilege: Runs as a non-root user (UID 2002) to prevent host-level exploits.

Attack Surface: By removing compilers and build tools, you give hackers fewer "toys" to play with if they ever break in.

Operational Efficiency: * Fast Deploys: Optimized layer caching means code updates happen in seconds.

Graceful Exit: Uses SIGTERM handling to ensure the app shuts down without losing data or dropping active requests.
@bito-code-review
Copy link

Bito Review Skipped - Source Branch Not Found

Bito didn't review this change because the pull request is no longer valid. It may have been merged, or the source/target branch may no longer exist.

@sonarqubecloud
Copy link

@Armaan-Sharma-nspl
Copy link
Author

"Hi @prakarsh-dt, @vikramdevtron, and @vivek-devtron — just checking in on this PR. The SonarQube quality gate has passed with 0 issues. Whenever you have a moment, I'd appreciate your feedback on the multi-stage build implementation."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant