feat: Complete Docker infrastructure and CI/CD pipeline
Some checks failed
ParentFlow CI/CD Pipeline / Backend Tests (push) Has been cancelled
ParentFlow CI/CD Pipeline / Frontend Tests (push) Has been cancelled
ParentFlow CI/CD Pipeline / Security Scanning (push) Has been cancelled
ParentFlow CI/CD Pipeline / Build Docker Images (map[context:maternal-app/maternal-app-backend dockerfile:Dockerfile.production name:backend]) (push) Has been cancelled
ParentFlow CI/CD Pipeline / Build Docker Images (map[context:maternal-web dockerfile:Dockerfile.production name:frontend]) (push) Has been cancelled
ParentFlow CI/CD Pipeline / Deploy to Development (push) Has been cancelled
ParentFlow CI/CD Pipeline / Deploy to Production (push) Has been cancelled
CI/CD Pipeline / Lint and Test (push) Has been cancelled
CI/CD Pipeline / E2E Tests (push) Has been cancelled
CI/CD Pipeline / Build Application (push) Has been cancelled

- Created production-ready Dockerfiles with multi-stage builds
- Implemented complete CI/CD pipeline with GitHub Actions:
  - Automated testing for backend and frontend
  - Security scanning with Trivy
  - Docker image building and pushing to GHCR
  - Automated deployments to dev and production
  - Zero-downtime deployment strategy with rollback
- Set up docker-compose for both development and production
- Configured Nginx reverse proxy with SSL support
- Domain configuration:
  - Development: maternal.noru1.ro:3005, maternal-api.noru1.ro:3015
  - Production: parentflowapp.com, api.parentflowapp.com
- Created comprehensive health check endpoints for monitoring
- Updated port configuration for development environment
- Added environment-specific configuration files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-06 13:49:28 +00:00
parent 492d480651
commit a6b3ad67fb
14 changed files with 1618 additions and 30 deletions

155
docker-compose.dev.yml Normal file
View File

@@ -0,0 +1,155 @@
version: '3.8'
services:
# PostgreSQL Database (Development)
postgres-dev:
image: postgres:15-alpine
container_name: maternal-postgres-dev
restart: unless-stopped
ports:
- "5555:5432"
environment:
POSTGRES_DB: maternal_app
POSTGRES_USER: maternal_user
POSTGRES_PASSWORD: maternal_dev_password_2024
volumes:
- postgres_dev_data:/var/lib/postgresql/data
- ./maternal-app/maternal-app-backend/src/database/migrations:/docker-entrypoint-initdb.d:ro
networks:
- maternal-dev-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U maternal_user"]
interval: 10s
timeout: 5s
retries: 5
# Redis Cache (Development)
redis-dev:
image: redis:7-alpine
container_name: maternal-redis-dev
restart: unless-stopped
ports:
- "6666:6379"
volumes:
- redis_dev_data:/data
networks:
- maternal-dev-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 5
# MongoDB for AI Chat History (Development)
mongodb-dev:
image: mongo:7
container_name: maternal-mongodb-dev
restart: unless-stopped
ports:
- "27777:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: maternal_admin
MONGO_INITDB_ROOT_PASSWORD: maternal_mongo_password_2024
MONGO_INITDB_DATABASE: maternal_ai_chat
volumes:
- mongo_dev_data:/data/db
networks:
- maternal-dev-network
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
# MinIO Object Storage (Development)
minio-dev:
image: minio/minio:latest
container_name: maternal-minio-dev
restart: unless-stopped
ports:
- "9002:9000"
- "9003:9001" # Console
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: maternal_minio_admin
MINIO_ROOT_PASSWORD: maternal_minio_password_2024
volumes:
- minio_dev_data:/data
networks:
- maternal-dev-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
# Backend API (Development)
backend-dev:
build:
context: ./maternal-app/maternal-app-backend
dockerfile: Dockerfile
container_name: maternal-backend-dev
restart: unless-stopped
ports:
- "3015:3015"
environment:
- NODE_ENV=development
- API_PORT=3015
- DATABASE_HOST=postgres-dev
- REDIS_HOST=redis-dev
- MONGODB_HOST=mongodb-dev
- MINIO_ENDPOINT=http://minio-dev:9000
env_file:
- ./maternal-app/maternal-app-backend/.env
volumes:
- ./maternal-app/maternal-app-backend:/app
- /app/node_modules
depends_on:
postgres-dev:
condition: service_healthy
redis-dev:
condition: service_healthy
mongodb-dev:
condition: service_healthy
networks:
- maternal-dev-network
command: npm run start:dev
# Frontend Application (Development)
frontend-dev:
build:
context: ./maternal-web
dockerfile: Dockerfile
container_name: maternal-frontend-dev
restart: unless-stopped
ports:
- "3005:3005"
environment:
- NODE_ENV=development
- PORT=3005
- NEXT_PUBLIC_API_URL=https://maternal-api.noru1.ro
env_file:
- ./maternal-web/.env.local
volumes:
- ./maternal-web:/app
- /app/node_modules
- /app/.next
depends_on:
- backend-dev
networks:
- maternal-dev-network
command: npm run dev -- -p 3005
networks:
maternal-dev-network:
driver: bridge
volumes:
postgres_dev_data:
driver: local
redis_dev_data:
driver: local
mongo_dev_data:
driver: local
minio_dev_data:
driver: local