feat: Add optimized Docker implementation with banking-grade security#10
Open
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
Open
feat: Add optimized Docker implementation with banking-grade security#10devin-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 - Configure non-root user (nestjs) for security - Add health checks and proper signal handling - Optimize image layers and reduce final image size - Support PostgreSQL and Redis connectivity - 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 introduces a comprehensive Docker implementation for the banking application with multi-stage builds, security hardening, and full local development support. The implementation includes optimized Docker images for both development and production environments, with a complete docker-compose setup supporting PostgreSQL, Redis, and proper service networking.
Key Features:
Technical Changes:
.dockerignorefiles to optimize build contextDockerfileandDockerfile.devfor both applicationsnginx.conffor production frontend serving with security headersReview & Testing Checklist for Human
docker-compose upfrom scratch and verify all 4 services (postgres, redis, bank-server, bank-client) start healthy and can communicatedocker build --target production) and verify they run correctly with proper non-root user permissionsRecommended Test Plan:
docker system prune -fdocker-compose up -ddocker-compose pshttp://localhost:3000curl http://localhost:4000/bank/CurrenciesDiagram
%%{ init : { "theme" : "default" }}%% graph TB subgraph "Bank Client (React)" ClientDockerfile["bank-client/Dockerfile"]:::major-edit ClientDockerfileDev["bank-client/Dockerfile.dev"]:::major-edit ClientDockerignore["bank-client/.dockerignore"]:::major-edit NginxConf["bank-client/nginx.conf"]:::major-edit WebpackConfig["bank-client/internals/webpack/webpack.base.babel.js"]:::minor-edit ApiConfig["bank-client/app/utils/api.js"]:::minor-edit end subgraph "Bank Server (NestJS)" ServerDockerfile["bank-server/Dockerfile"]:::major-edit ServerDockerfileDev["bank-server/Dockerfile.dev"]:::major-edit ServerDockerignore["bank-server/.dockerignore"]:::major-edit end subgraph "Docker Compose Stack" DockerCompose["docker-compose.yml"]:::major-edit DockerComposeProd["docker-compose.prod.yml"]:::major-edit InitDB["init-db.sql"]:::major-edit end subgraph "Security & Documentation" SecurityScan["security-scan.yml"]:::major-edit SecurityDocs["DOCKER_SECURITY.md"]:::major-edit end DockerCompose --> ClientDockerfile DockerCompose --> ServerDockerfile DockerCompose --> InitDB ClientDockerfile --> NginxConf ClientDockerfile --> WebpackConfig ServerDockerfile --> ApiConfig 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
Important Security Considerations:
Known Issues:
NODE_OPTIONS="--openssl-legacy-provider"and disabling some webpack plugins.Session Information:
The implementation follows banking-grade security practices and has been tested with the complete stack running successfully. All containers achieve healthy status and can communicate properly through the custom Docker network.