feat: Add optimized Docker implementation with banking-grade security#7
Open
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
Open
feat: Add optimized Docker implementation with banking-grade security#7devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
Conversation
- Add multi-stage Dockerfile with development and production targets - Add separate Dockerfile.dev for development with hot reload - Add .dockerignore to optimize build context - Add nginx.conf for production serving with security headers - Configure non-root user (reactjs/nginx-app) for security - Add health checks and proper signal handling - Optimize image layers and reduce final image size - Fix webpack configuration for Node.js 18 compatibility - Configure API base URL via environment variable - Include banking-grade security practices Co-Authored-By: Arthur Poon <arthur.poon@windsurf.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
feat: Add optimized Docker implementation with banking-grade security
Summary
This PR implements a comprehensive Docker solution for the banking application with multi-stage builds, security hardening, and development/production configurations. The implementation includes:
Core Docker Infrastructure:
Security Features:
Development Experience:
Production Optimizations:
Review & Testing Checklist for Human
docker-compose upand verify all 4 services start healthy, test frontend at http://localhost:3000 and API at http://localhost:4000/bank/Currenciesdocker build --target productionfor both applications and verify they serve correctlyRecommended Test Plan:
docker system prune -fdocker-compose up -ddocker-compose ps(all should show "healthy")curl http://localhost:4000/bank/Currenciesshould return currency datadocker run --rm -v /var/run/docker.sock:/var/run/docker.sock aquasec/trivy image bank-server:prodDiagram
%%{ init : { "theme" : "default" }}%% graph TB subgraph "Frontend (bank-client)" ClientDockerfile["Dockerfile<br/>(Multi-stage)"]:::major-edit ClientDockerfileDev["Dockerfile.dev<br/>(Development)"]:::major-edit ClientDockerignore[".dockerignore"]:::major-edit NginxConf["nginx.conf<br/>(Security headers)"]:::major-edit ApiJs["app/utils/api.js<br/>(ENV config)"]:::minor-edit WebpackBase["webpack.base.babel.js<br/>(Node 18 fixes)"]:::minor-edit end subgraph "Backend (bank-server)" ServerDockerfile["Dockerfile<br/>(Multi-stage)"]:::major-edit ServerDockerfileDev["Dockerfile.dev<br/>(Development)"]:::major-edit ServerDockerignore[".dockerignore"]:::major-edit end subgraph "Infrastructure" DockerCompose["docker-compose.yml<br/>(Dev stack)"]:::major-edit DockerComposeProd["docker-compose.prod.yml<br/>(Production)"]:::major-edit InitDb["init-db.sql<br/>(Database setup)"]:::major-edit SecurityScan["security-scan.yml<br/>(Trivy integration)"]:::major-edit end DockerCompose --> ClientDockerfileDev DockerCompose --> ServerDockerfileDev DockerCompose --> InitDb ClientDockerfile --> NginxConf ServerDockerfile --> ServerDockerignore ClientDockerfile --> ClientDockerignore subgraph Legend L1["Major Edit"]:::major-edit L2["Minor Edit"]:::minor-edit L3["Context/No Edit"]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFFNotes
Key Implementation Decisions:
offline-pluginandimage-webpack-loaderdue to Node.js 18 compatibility issues and OpenSSL legacy provider requirements/bank/Currenciesendpoint for backend health checks as it's publicly accessible and returns dataSecurity Considerations:
Potential Risks:
Link to Devin run: https://app.devin.ai/sessions/55a8838ca29e44f7abba8897acb7e9ea
Requested by: @akkp-windsurf (Arthur Poon)