diff --git a/docker-compose.ollama.yaml b/docker-compose.ollama.yaml index 895d93f..7d399e6 100644 --- a/docker-compose.ollama.yaml +++ b/docker-compose.ollama.yaml @@ -1,36 +1,36 @@ version: '3.8' services: - traefik: - image: traefik:v2.11 - container_name: traefik - command: - - "--api.insecure=true" - - "--providers.docker=true" - - "--entrypoints.web.address=:80" - - "--entrypoints.websecure.address=:443" - ports: - - "80:80" - - "443:443" - - "8080:8080" - volumes: - - /var/run/docker.sock:/var/run/docker.sock - - ./data/ssl:/letsencrypt - restart: always + # traefik: + # image: traefik:v2.11 + # container_name: traefik + # command: + # - "--api.insecure=true" + # - "--providers.docker=true" + # - "--entrypoints.web.address=:80" + # - "--entrypoints.websecure.address=:443" + # ports: + # - "80:80" + # - "443:443" + # - "8080:8080" + # volumes: + # - /var/run/docker.sock:/var/run/docker.sock + # - ./data/ssl:/letsencrypt + # restart: always - frontend_app: - image: cr.yandex/crpc50gkvq2bp251sfgb/app - container_name: frontend_app - build: - context: ./frontend - dockerfile: Dockerfile - environment: - - API_URL=http://api.${HOST} - labels: - - "traefik.enable=true" - - "traefik.http.routers.app.rule=Host(`${HOST}`)" - - "traefik.http.routers.app.entrypoints=web" - - "traefik.http.services.app.loadbalancer.server.port=3000" + # frontend_app: + # image: cr.yandex/crpc50gkvq2bp251sfgb/app + # container_name: frontend_app + # build: + # context: ./frontend + # dockerfile: Dockerfile + # environment: + # - API_URL=http://api.${HOST} + # labels: + # - "traefik.enable=true" + # - "traefik.http.routers.app.rule=Host(`${HOST}`)" + # - "traefik.http.routers.app.entrypoints=web" + # - "traefik.http.services.app.loadbalancer.server.port=3000" backend_app: restart: unless-stopped @@ -50,7 +50,7 @@ services: - db - redis ports: - - 5001:5000 + - 5000:5000 labels: - "traefik.enable=true" - "traefik.http.routers.api.rule=Host(`api.${HOST}`)" diff --git a/docker-compose.yaml b/docker-compose.yaml index 0d8679b..70b4c97 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -89,7 +89,7 @@ services: build: context: ./services/backend dockerfile: Dockerfile - entrypoint: celery -A celery_worker.celery worker --loglevel=info + command: celery -A celery_worker.celery worker --loglevel=info volumes: - ./services/backend:/app environment: diff --git a/frontend/src/app/components/Sidebar.tsx b/frontend/src/app/components/Sidebar.tsx index 7dda7e7..2b8533b 100644 --- a/frontend/src/app/components/Sidebar.tsx +++ b/frontend/src/app/components/Sidebar.tsx @@ -1,7 +1,8 @@ -import React, { useRef, useCallback } from 'react'; +import React, { useRef } from 'react'; import Link from 'next/link'; import { motion, AnimatePresence } from 'framer-motion'; import { Button } from "@/components/ui/button" +import { useRouter } from 'next/navigation'; type Conversation = { id: number; @@ -19,78 +20,9 @@ type SidebarProps = { onCloseSidebar: () => void; }; -type ConversationItemProps = { - conversation: Conversation; - isActive: boolean; - onConversationChange: (id: number) => void; - onDeleteConversation: (id: number) => void; -}; - -const ConversationItem = React.memo(({ conversation, isActive, onConversationChange, onDeleteConversation }: ConversationItemProps) => { - return ( - - { - e.preventDefault(); - onConversationChange(conversation.id); - }} - > - - - - ); -}); - export default function Sidebar({ conversations, currentConversationId, onConversationChange, onAddConversation, onDeleteConversation, isSidebarOpen, onCloseSidebar }: SidebarProps) { const menuRef = useRef(null); - - const handleConversationChange = useCallback((id: number) => { - onConversationChange(id); - }, [onConversationChange]); - - const handleDeleteConversation = useCallback((id: number) => { - onDeleteConversation(id); - }, [onDeleteConversation]); + const router = useRouter(); return (