Add React frontend to Docker Compose
- Created frontend/Dockerfile with multi-stage build for optimized production bundle - Created frontend/.dockerignore to exclude node_modules and build artifacts - Added frontend service to docker-compose.yml with: - Auto-build from frontend/Dockerfile - Port 3000 mapping - Health checks (wget to http://localhost:3000) - Dependency on healthy Kafka and Redis - Production environment (NODE_ENV=production) - Auto-restart on failure - Proper network connectivity - Created DOCKER_QUICK_START.md with simplified setup guide: - Single docker compose up starts infrastructure + frontend - Cleaner workflow (2-3 terminals instead of 4) - Production-like testing (not dev mode) - Complete troubleshooting section - Updated FULLSTACK_GUIDE.md to highlight Docker-integrated frontend - Frontend now runs as optimized 63KB gzip production build in Docker All components now start together: docker compose up # Infrastructure + React frontend (Docker) uvicorn api.main:app # API (your terminal) python pipeline.py # Consumer (your terminal) Access frontend at: http://localhost:3000 Co-authored-by: Copilot <[email protected]>
This commit is contained in:
1 parent
6504ff4c2a
commit
e169bc8b36
5 files changed
+330
No files matched your search
@@ -47,6 +47,28 @@ services:
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
|
||||
frontend:
|
||||
build:
|
||||
context: ./frontend
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "3000:3000"
|
||||
networks:
|
||||
- payguard-network
|
||||
depends_on:
|
||||
kafka:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: wget --quiet --tries=1 --spider http://localhost:3000 || exit 1
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
redis_data:
|
||||
|
||||
|
||||
Reference in new issue
Block a user