Skip to content

Optimize Docker Build #78

Description

@nursetechie

Issue #38 — ci: Optimize Docker Build

Description

Bloated Docker images increase deployment times, consume excessive bandwidth, and expand the attack surface. Optimizing the Dockerfile ensures a lean, secure, production-ready artifact that only contains necessary runtime code.


Requirements & Context

Architectural Goal: Create an immutable, highly optimized deployment artifact.

Implementation Expectations: Refactor the existing Dockerfile to use multi-stage builds. Strip out devDependencies from the final image. Execute the Node process as an unprivileged non-root user.


Acceptance Criteria

  • The final image size is drastically reduced.
  • The container successfully runs the application without root privileges.

Out of Scope

  • Multi-architecture builds (e.g., ARM64 + AMD64 configurations).

Suggested Execution

git checkout -b ci/docker-optimization

Suggested Commit Message

ci: optimize dockerfile for production sizes and security

Testing Notes

  • Build the image locally and inspect its layers. Exec into the container and verify whoami is not root.

References

Node.js Docker Best Practices.


Definition of Done

  • Ready for review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions