- Add Frontend Dockerfile with Next.js standalone build - Add docker-compose.yml for production deployment - Add docker-compose.dev.yml for development with hot-reload - Configure Frontend next.config.js with standalone output - Add .dockerignore files for both backend and frontend - Add comprehensive README-DOCKER.md documentation - Update .gitignore to exclude node_modules and build artifacts - Remove obsolete component files (CycleCalculator.tsx, PHDiagram.tsx) - Backend and Frontend communicate via Docker network - Healthchecks configured for both services - Environment variables configured for API URL
60 lines
1.4 KiB
YAML
60 lines
1.4 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# Backend API Service
|
|
backend:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: diagramph-backend
|
|
ports:
|
|
- "8001:8001"
|
|
volumes:
|
|
- ./app:/app/app:cached
|
|
- ./IPM_SO:/app/IPM_SO:cached
|
|
- ./IPM_DLL:/app/IPM_DLL:cached
|
|
environment:
|
|
- PYTHONUNBUFFERED=1
|
|
- PYTHONPATH=/app:/app/IPM_SO:/app/IPM_DLL
|
|
- LD_LIBRARY_PATH=/app/IPM_SO:/app/IPM_DLL
|
|
command: uvicorn app.main:app --host 0.0.0.0 --port 8001 --reload
|
|
networks:
|
|
- diagramph-network
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8001/api/v1/refrigerants/"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
# Frontend Service
|
|
frontend:
|
|
build:
|
|
context: ./Frontend
|
|
dockerfile: Dockerfile
|
|
container_name: diagramph-frontend
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
- NODE_ENV=production
|
|
- NEXT_PUBLIC_API_URL=http://backend:8001/api/v1
|
|
depends_on:
|
|
backend:
|
|
condition: service_healthy
|
|
networks:
|
|
- diagramph-network
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
networks:
|
|
diagramph-network:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
backend-data:
|
|
frontend-data:
|