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
-
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}$.
-
Frontend Dockerfile Optimization (
frontend/Dockerfile):
- Next.js standalone output build (
output: 'standalone' in next.config.ts).
- Image size reduction to $< 120\text{MB}$.
-
Health Check Probes:
- Add native Docker healthcheck instructions calling
/health.
Target Files
backend/Dockerfile
frontend/Dockerfile
docker-compose.yml
Acceptance Criteria
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
backend/Dockerfile):node:20-alpinebase image.nodeuser (USER node).frontend/Dockerfile):output: 'standalone'innext.config.ts)./health.Target Files
backend/Dockerfilefrontend/Dockerfiledocker-compose.ymlAcceptance Criteria