version: '3.8' services: web: mem_limit: 2g build: . ports: - "5001:3000" # Host:Container environment: - MONGODB_URI=mongodb://mongo:27017/my_app - DATABASE_URL=postgresql://postgres:nour1234@postgres:5432/dashboarddb depends_on: - mongo - postgres healthcheck: test: ["CMD-SHELL", "curl -f http://localhost:3000 || exit 1"] interval: 10s timeout: 5s retries: 10 mongo: image: mongo:latest ports: - "27017:27017" volumes: - mongo-data:/data/db postgres: image: postgres:latest restart: always environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=nour1234 - POSTGRES_DB=dashboarddb healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 10s timeout: 5s retries: 5 ports: - "5432:5432" volumes: - postgres-data:/var/lib/postgresql/data volumes: mongo-data: postgres-data: