flowfi icon indicating copy to clipboard operation
flowfi copied to clipboard

[DevOps] Docker Multi-Stage Production Build Optimization & Security Hardening

Open blurbeast opened this issue 3 months ago • 7 comments

Overview & Background

Production Docker containers for FlowFi backend and frontend must be lightweight, fast to build, and hardened against container breakout vulnerabilities.


Technical Specification & Architecture

  1. Backend Dockerfile Optimization (backend/Dockerfile):
    • Multi-stage build (Builder -> Production Runner).
    • Use minimal node:20-alpine base image.
    • Execute under non-root node user (USER node).
    • Reduce image size from $> 800\text{MB}$ to $< 150\text{MB}$.
  2. Frontend Dockerfile Optimization (frontend/Dockerfile):
    • Next.js standalone output build (output: 'standalone' in next.config.ts).
    • Image size reduction to $< 120\text{MB}$.
  3. Health Check Probes:
    • Add native Docker healthcheck instructions calling /health.

Target Files

  • backend/Dockerfile
  • frontend/Dockerfile
  • docker-compose.yml

Acceptance Criteria

  • [ ] Docker container images build cleanly with $< 150\text{MB}$ final size.
  • [ ] Containers run as non-root user.
  • [ ] Healthcheck probes report healthy status in container orchestrators.

blurbeast avatar Aug 29 '26 22:08 blurbeast

Please assign ETA is 4 hours

Hello! I'd like to work on this issue.

Execution Plan for [DevOps] Docker Multi-Stage Production Build Optimization & Security Hardening:

  • UI & Component Design: Build [DevOps] Docker Multi-Stage Production Build Optimization & Security Hardening with modular React/Next.js components, responsive layouts, and robust loading/error boundaries.
  • Strict Typing & State: Ensure zero any types, smooth wallet state transitions, and responsive mobile/desktop rendering.
  • Quality Gate: Include component tests (Vitest/Jest) and verify clean production build (pnpm build).

Why assign me?

  • Proven Proof-of-Work: #1 contributor on Mova Store (28 merged Web3 PRs) and official ElizaOS contributor.
  • Fast Turnaround: Dedicated to shipping a tested, production-grade PR within 12–24 hours.
  • Zero Maintainer Burden: Self-documenting code with green CI and tests included so you don't spend time debugging.

Excited to contribute—please assign this to me and I'll push a clean PR shortly!

Ranjeet2063 avatar Sep 06 '26 10:09 Ranjeet2063

Hi everyone,

I would love to take this on. My planned approach:

  • Build [DevOps] Docker Multi-Stage Production Build Optimization & Security Hardening with clean React/Next.js components, responsive styling, and proper loading/error boundaries.
  • Add component unit tests and ensure zero TypeScript/ESLint warnings.

Excited to work on this—please assign to me and I'll submit a clean PR shortly!

guptakumarranjeet150 avatar Sep 09 '26 00:09 guptakumarranjeet150

Hi maintainers,

I would love to take this on. My planned approach:

  • Build [DevOps] Docker Multi-Stage Production Build Optimization & Security Hardening with clean React/Next.js components, responsive styling, and proper loading/error boundaries.
  • Add component unit tests and ensure zero TypeScript/ESLint warnings.

Happy to pick this up today—please assign to me!

shobhamerabacha-star avatar Sep 09 '26 17:09 shobhamerabacha-star

@nemeregiftbrown-byte has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

Hi maintainer, please i will love to work on this issue.

ℹ️ Repo Maintainers: To accept this application, review their application or assign @nemeregiftbrown-byte to this issue.

nemeregiftbrown-byte avatar Sep 27 '26 15:09 nemeregiftbrown-byte

Congratulations, @nemeregiftbrown-byte! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.

🧑‍💻 @nemeregiftbrown-byte: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

🌊 Happy Wave 🌊

drips-wave[bot] avatar Sep 27 '26 18:09 drips-wave[bot]

This issue has been marked as completed by a Drips Wave moderator for @nemeregiftbrown-byte as part of the Stellar Wave Program's 9th Wave 🥳

Moderator's reason: [Auto-assessed] The PR successfully implements multi-stage Dockerfiles for both backend and frontend, configures non-root user execution, and adds native health checks and Next.js standalone output as specified in issue #1335. There are no maintainer objections or review comments across any channel, CI checks are passing, and diff coverage is complete.

😎 @nemeregiftbrown-byte: You earned 200 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here.

🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

ℹ️ Note: This issue was marked complete via moderation. Points were issued even though the GitHub issue remains open.

drips-wave[bot] avatar Oct 07 '26 12:10 drips-wave[bot]