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

View File

@@ -0,0 +1,20 @@
# Use an official Node.js runtime as a parent image
FROM node:18-slim
# Set the working directory in the container
WORKDIR /usr/src/app
# Copy package.json and package-lock.json (or yarn.lock)
COPY package*.json ./
# Install application dependencies
RUN npm install
# Bundle app source
COPY . .
# Expose the port the app runs on (if it has an HTTP server for internal checks, though not strictly necessary for a router)
EXPOSE 3001
# Define the command to run the app
CMD [ "node", "router.js" ]

View File

@@ -0,0 +1,12 @@
{
"name": "whatsapp-router",
"version": "1.0.0",
"description": "WhatsApp Router for OpenWA and LLM Agent",
"main": "router.js",
"scripts": {
"start": "node router.js"
},
"dependencies": {
"express": "^4.17.1"
}
}

16
whatsapp-router/router.js Normal file
View File

@@ -0,0 +1,16 @@
const express = require('express');
const app = express();
const PORT = process.env.PORT || 3001;
app.use(express.json());
app.post('/webhook', (req, res) => {
console.log('Received webhook event:', req.body);
// Logic to process OpenWA event and interact with LLM agent will go here
res.status(200).send('Event received');
});
app.listen(PORT, () => {
console.log(`WhatsApp Router listening on port ${PORT}`);
console.log('Webhook endpoint available at /webhook');
});