diff --git a/.env b/.env index 0c5470e..7e9f218 100644 --- a/.env +++ b/.env @@ -23,7 +23,8 @@ AIDER_4=false GROQ_API_KEY=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 -aider --model groq/llama3-70b-8192 +OPENAI_API_KEY=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 +# aider --model groq/llama3-70b-8192 # List models available from Groq -aider --models groq/ \ No newline at end of file +# aider --models groq/ \ No newline at end of file diff --git a/.env.demo b/.env.demo index 38be4ef..fea3dc7 100644 --- a/.env.demo +++ b/.env.demo @@ -5,7 +5,7 @@ # SERVER_PORT_WS=8081 # SERVER_PORT_HTTP=8080 -ENV_NAME=development +ENV_NAME=demo TTS_API_URL=https://api.tts.d-popov.com/asr # LLN_MODEL=qwen2 @@ -19,5 +19,5 @@ OPENAI_API_KEY=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 WS_URL=wss://tts.d-popov.com PUBLIC_HOSTNAME=tts.d-popov.com -SERVER_PORT_WS=8080 -SERVER_PORT_HTTP=8080 \ No newline at end of file +SERVER_PORT_HTTP=8080 +SERVER_PORT_WS=8081 \ No newline at end of file diff --git a/_doc/_notes/readme.md b/_doc/_notes/readme.md index c3f9f72..25e9ed8 100644 --- a/_doc/_notes/readme.md +++ b/_doc/_notes/readme.md @@ -1,4 +1,9 @@ -start the project in container: -# -#for debugging: -# docker-compose -f docker-compose.debug.yml up +# build: +docker build -t kevin-ai . +# start the project in container: +docker-compose up +# for debugging: +docker-compose -f docker-compose.debug.yml up + +# demo (only node) +# docker-compose -f docker-compose.demo.yml up diff --git a/docker-compose.demo.yml b/docker-compose.demo.yml new file mode 100644 index 0000000..0cc78d3 --- /dev/null +++ b/docker-compose.demo.yml @@ -0,0 +1,15 @@ +version: '3.8' + +services: + node-app: + container_name: node-voice-chat + build: + context: . + dockerfile: web/deploy/demo.Dockerfile + ports: + - "8880:8080" # Exposes port 3000 on the host and maps it to port 3000 on the container + volumes: + - .:/usr/src/app # Mounts the current directory to /usr/src/app in the container + environment: + NODE_ENV: demo # Sets the environment variable NODE_ENV to development + command: npm run start:demo-chat # Runs npm start when the container starts diff --git a/docker-compose.yml b/docker-compose.yml index 009026c..6ab5833 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,35 @@ services: + # kevinai: + # image: kevinai + # container_name: kevinai-dev + # build: + # context: . + # dockerfile: ./Dockerfile + # environment: + # NODE_ENV: production + # # TTS_BACKEND_URL: http://192.168.0.10:9009/asr + # WS_URL: ws://192.168.0.10:28081 + # SERVER_PORT_WS: 8081 + # SERVER_PORT_HTTP: 8080 + # ports: + # - 28081:8081 + # - 28080:8080 + mlchat: + image: kevinai + container_name: kevinai-chat + build: + context: . + dockerfile: ./Dockerfile + environment: + NODE_ENV: demo + # TTS_BACKEND_URL: http://192.168.0.10:9009/asr + WS_URL: wss://tts.d-popov.com + SERVER_PORT_WS: 8081 + SERVER_PORT_HTTP: 8080 + SERVER_PORT_WS: 8082 + ports: + - 28080:8080 + - 28081:8081 chat-server: image: node:20-alpine container_name: ml-voice-chat-server @@ -19,4 +50,4 @@ services: - 28081:8082 dns: - 8.8.8.8 - - 8.8.4.4 \ No newline at end of file + - 8.8.4.4 diff --git a/package.json b/package.json index ecb862d..79e272c 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,11 @@ "start:demo": "NODE_ENV=demo node web/server.js", "start:demo-chat": "node web/chat-server.js", "start:tele": "python agent-py-bot/agent.py" - }, + + }, + "env": { + "NODE_ENV": "demo" + }, "dependencies": { "axios": "^1.7.2", "body-parser": "^1.20.2", diff --git a/web/.env b/web/.env new file mode 100644 index 0000000..38be4ef --- /dev/null +++ b/web/.env @@ -0,0 +1,23 @@ + + +# TTS_BACKEND_URL=http://192.168.0.10:9008/asr +# WS_URL=ws://192.168.0.10:9008 +# SERVER_PORT_WS=8081 +# SERVER_PORT_HTTP=8080 + +ENV_NAME=development +TTS_API_URL=https://api.tts.d-popov.com/asr + +# LLN_MODEL=qwen2 +# LNN_API_URL=https://ollama.d-popov.com/api/generate + +LLN_MODEL=qwen2 +LNN_API_URL=https://ollama.d-popov.com/api/generate + +GROQ_API_KEY=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 +OPENAI_API_KEY=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 + +WS_URL=wss://tts.d-popov.com +PUBLIC_HOSTNAME=tts.d-popov.com +SERVER_PORT_WS=8080 +SERVER_PORT_HTTP=8080 \ No newline at end of file diff --git a/web/deploy/demo.Dockerfile b/web/deploy/demo.Dockerfile new file mode 100644 index 0000000..484a3ad --- /dev/null +++ b/web/deploy/demo.Dockerfile @@ -0,0 +1,20 @@ +# Use the official Node.js 14 image as a base image +FROM node:20 + +# Create and change to the app directory +WORKDIR /usr/src/app + +# Copy the package.json and package-lock.json files +COPY package*.json ./ + +# Install dependencies +RUN npm install + +# Copy the rest of the application code +COPY . . + +# Expose port 3000 +EXPOSE 8880 + +# Start the application +CMD ["npm", "run", "start:demo-chat"]