Skip to content

Commit

Permalink
FEAT: Add ai_backend in compose.pro
Browse files Browse the repository at this point in the history
  • Loading branch information
thinley4 committed Oct 27, 2024
1 parent eaa6d7b commit f418b33
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
6 changes: 3 additions & 3 deletions web/actions/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { redirect } from 'next/navigation'
export async function create(question: string, context: string, collectionName: string, apiKey: string | null) {

try {
const response = await axios.post("http://0.0.0.0:8880/getResponse", {
const response = await axios.post(`${process.env.AI_BACKEND_URL}:8880/getResponse`, {
question,
context,
collectionName,
Expand Down Expand Up @@ -38,7 +38,7 @@ export async function upload(formData: FormData) {
try {
const session = await auth();
const result = await axios.post(
"http://0.0.0.0:8880/upload",
`${process.env.AI_BACKEND_URL}:8880/upload`,
formData, // Send the formData instead of the file directly
{
headers: { "Content-Type": "multipart/form-data" },
Expand Down Expand Up @@ -71,7 +71,7 @@ export async function upload(formData: FormData) {

export async function deletePdf(collectionName: string){
try {
await axios.delete( "http://0.0.0.0:8880/del", {
await axios.delete( `${process.env.AI_BACKEND_URL}:8880/del`, {
data:{
collectionName: collectionName
}
Expand Down
11 changes: 9 additions & 2 deletions web/compose.pro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ services:
container_name: dchat-web
env_file:
- .env
ports:
- 3000:3000
restart: always
networks:
network_prod:
ipv4_address: 11.0.0.3
ai_backend:
image: thinley44/dchat-ai:latest
container_name: dchat-ai
env_file:
- .env
restart: always
networks:
network_prod:
ipv4_address: 11.0.0.4
networks:
network_prod:
name: prod
Expand Down

0 comments on commit f418b33

Please sign in to comment.