feat: Initial Docker Compose setup for conversation layer

Adds a docker-compose.yml to manage the OpenWA, Chat UI, and WhatsApp Router services.

Includes:
- Dockerfile and basic Node.js skeleton for Chat UI.
- Dockerfile and basic Node.js skeleton for WhatsApp Router.
- docker-compose.yml defining the three services, including:
    - Placeholder for OpenWA image (you must configure this).
    - Build contexts for UI and router.
    - Port mappings.
    - Environment variable examples.
    - Volume for OpenWA session persistence.
- Updated README.md with detailed setup, configuration, and usage instructions.
This commit is contained in:
google-labs-jules[bot]
2025-06-05 00:38:09 +00:00
parent 0004be3c09
commit e0ff27aa31
8 changed files with 229 additions and 1 deletions

67
docker-compose.yml Normal file
View File

@@ -0,0 +1,67 @@
version: '3.8'
services:
openwa:
# IMPORTANT: Replace with your specific OpenWA image if different.
# This is a commonly used one, but your setup might require another.
image: devlikeapro/open-wa-api:latest
ports:
# Default port for OpenWA API is often 8080. Adjust if your image uses a different one.
- "8080:8080"
# Port for the webhook if OpenWA serves it directly.
# This might also be configured via environment variables for OpenWA.
- "3000:3000" # Assuming OpenWA's webhook might be on 3000, adjust as needed
environment:
# Add any necessary environment variables for OpenWA here
# For example:
# - WEBHOOK_URL=http://whatsapp-router:3001/webhook
# The actual variable names will depend on the OpenWA image being used.
- SERVER_PORT=8080 # Example, may not be needed if image defaults correctly
volumes:
# Persist session data for OpenWA to avoid re-scanning QR code on restart
- openwa_data:/app/session
# networks:
# - conversation_net
chat-ui:
build:
context: ./chat-ui
dockerfile: Dockerfile
ports:
- "3002:3000" # Expose Chat UI on host port 3002, container port 3000
environment:
# Example: Endpoint for the LLM agent
# - LLM_AGENT_URL=http://your-llm-agent-service/api
- NODE_ENV=development
# depends_on:
# - openwa # If Chat UI needs to directly interact with OpenWA
# networks:
# - conversation_net
whatsapp-router:
build:
context: ./whatsapp-router
dockerfile: Dockerfile
ports:
- "3001:3001" # Expose WhatsApp Router on host port 3001, container port 3001
environment:
# URL for OpenWA API
- OPENWA_API_URL=http://openwa:8080
# URL where OpenWA should send webhook events
# This should match what OpenWA is configured to call
- OPENWA_WEBHOOK_TARGET=http://whatsapp-router:3001/webhook
# Example: Endpoint for the LLM agent (if router talks to it)
# - LLM_AGENT_URL=http://your-llm-agent-service/api
- NODE_ENV=development
depends_on:
- openwa # Router needs OpenWA to be up
# networks:
# - conversation_net
volumes:
openwa_data: # Named volume for OpenWA session data
# Optional: Define a shared network
# networks:
# conversation_net:
# driver: bridge