feat: Enhance provider components with detailed documentation and comments
- Added comprehensive comments and JSDoc-style documentation to NotificationProvider, ThemeProvider, UserProvider, and WebsiteThemeProvider for better clarity and maintainability. - Improved type definitions in index.ts for better code understanding and usage. - Introduced Docker support with Dockerfiles for various services including AI server, signaling server, and browser-use service. - Created a docker-compose.yml file to orchestrate multiple services including PostgreSQL, AI, scraper, and frontend. - Added a startup guide (startup.txt) for setting up the CRM environment on Ubuntu with Docker. - Included a .dockerignore file to exclude unnecessary files from Docker builds.
This commit is contained in:
@@ -0,0 +1,111 @@
|
||||
services:
|
||||
db:
|
||||
image: postgres:16-alpine
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: crm
|
||||
POSTGRES_USER: crm
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD:-crm}
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U crm"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
ollama:
|
||||
image: ollama/ollama
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ollama-models:/root/.ollama
|
||||
healthcheck:
|
||||
test: ["CMD", "ollama", "list"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
migrate:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ai-server/Dockerfile
|
||||
command: ["node", "scripts/run-migrations.mjs"]
|
||||
environment:
|
||||
DATABASE_URL: postgres://crm:${DB_PASSWORD:-crm}@db:5432/crm
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
restart: "no"
|
||||
|
||||
ai:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ai-server/Dockerfile
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3001:3001"
|
||||
environment:
|
||||
AI_PORT: 3001
|
||||
DATABASE_URL: postgres://crm:${DB_PASSWORD:-crm}@db:5432/crm
|
||||
OLLAMA_BASE_URL: http://ollama:11434
|
||||
SCRAPER_URL: http://scraper:3008
|
||||
FRONTEND_URL: http://next:3006
|
||||
AI_MODEL: ${AI_MODEL:-dolphin-llama3:8b}
|
||||
JWT_SECRET: ${JWT_SECRET}
|
||||
SELECTED_BROWSER: ${SELECTED_BROWSER:-firefox}
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
ollama:
|
||||
condition: service_started
|
||||
|
||||
scraper:
|
||||
build:
|
||||
context: ./browser-use-service
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3008:3008"
|
||||
environment:
|
||||
PORT: 3008
|
||||
OLLAMA_URL: http://ollama:11434
|
||||
CLASSIFY_MODEL: ${CLASSIFY_MODEL:-dolphin-llama3:8b}
|
||||
CORS_ORIGINS: http://localhost:3006,http://next:3006
|
||||
depends_on:
|
||||
- ollama
|
||||
|
||||
next:
|
||||
build:
|
||||
context: .
|
||||
args:
|
||||
NEXT_PUBLIC_SCRAPER_URL: ${NEXT_PUBLIC_SCRAPER_URL:-http://localhost:3008}
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3006:3006"
|
||||
environment:
|
||||
DATABASE_URL: postgres://crm:${DB_PASSWORD:-crm}@db:5432/crm
|
||||
AI_SERVICE_URL: http://ai:3001
|
||||
JWT_SECRET: ${JWT_SECRET}
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
migrate:
|
||||
condition: service_completed_successfully
|
||||
|
||||
signaling:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.signaling
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3007:3007"
|
||||
environment:
|
||||
SIGNALING_PORT: 3007
|
||||
DATABASE_URL: postgres://crm:${DB_PASSWORD:-crm}@db:5432/crm
|
||||
JWT_SECRET: ${JWT_SECRET}
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
ollama-models:
|
||||
Reference in New Issue
Block a user