From 4bb63ae98d22fd99830f0df40665c3aaabf64e98 Mon Sep 17 00:00:00 2001 From: Abhinav Pandey Date: Sun, 30 Jun 2024 03:06:30 +0530 Subject: [PATCH] Update Structures Signed-off-by: Abhinav Pandey --- DEV_INTRO.md | 18 +++++++++++++++++- docker-compose.yml | 3 +-- run_docker.sh | 14 ++++++++++++++ run_llama.sh | 22 ---------------------- 4 files changed, 32 insertions(+), 25 deletions(-) create mode 100644 run_docker.sh delete mode 100644 run_llama.sh diff --git a/DEV_INTRO.md b/DEV_INTRO.md index 00a364b..1c15794 100644 --- a/DEV_INTRO.md +++ b/DEV_INTRO.md @@ -17,6 +17,10 @@ The CatGPT project is structured as follows: ```bash CatGPT/ │ +├── ollama/ +│ ├── Dockerfile +│ ├── start.sh +│ ├── client/ # Frontend React + Typescript application │ ├── src/ │ ├── public/ @@ -37,6 +41,7 @@ CatGPT/ │ ├── README.md # Project overview and setup instructions └── docker-compose.yml # Docker configuration for local development +└── run_llama.sh ``` ## Setting Up Your Development Environment @@ -55,7 +60,7 @@ cd CatGPT Docker Compose is used to simplify the process of building and running multi-container Docker applications. To start both the frontend and backend services, use the following command: ```bash -./start.sh +./run_docker.sh ``` This command performs the following actions: @@ -96,6 +101,17 @@ To bring your containers back online, use the following command : docker-compose up -d ``` +## Testing + +To test if Ollama is up and runing, try the below bahs command : + +```bash +curl http://localhost:11434/api/generate -d '{ + "model": "llama3", + "prompt": "Why is the sky blue?" +}' +``` + ## Conclusion This guide should help you get started with developing the CatGPT project using Docker. For any additional information or help, refer to the main `README.md` or contact the project maintainers. diff --git a/docker-compose.yml b/docker-compose.yml index 58a8080..071c763 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,9 +29,8 @@ services: container_name: ollama volumes: - ollama:/root/.ollama - - ./ollama/start.sh:/start.sh ports: - - "11434:11434" + - 11434:11434 entrypoint: ["/bin/bash", "/start.sh"] volumes: diff --git a/run_docker.sh b/run_docker.sh new file mode 100644 index 0000000..a4b1310 --- /dev/null +++ b/run_docker.sh @@ -0,0 +1,14 @@ +#!/bin/bash +GREEN="\033[0;32m" +BLUE="\033[0;34m" +YELLOW="\033[1;33m" +RED="\033[0;31m" +VIOLET="\033[0;35m" +NC="\033[0m" + +echo -e "\n${YELLOW}🚀 Starting Docker Compose services...${NC}" +docker compose up -d +echo -e "\n" + + +echo -e "${GREEN}🏃 Start Chatting...${NC}" \ No newline at end of file diff --git a/run_llama.sh b/run_llama.sh deleted file mode 100644 index 907813c..0000000 --- a/run_llama.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -GREEN="\033[0;32m" -BLUE="\033[0;34m" -YELLOW="\033[1;33m" -RED="\033[0;31m" -VIOLET="\033[0;35m" -NC="\033[0m" - -echo -e "\n${YELLOW}🚀 Starting Docker Compose services...${NC}" -docker compose up -d -echo -e "\n" - -echo -e "${BLUE}⏳ Waiting for services to start...${NC}" -for i in {3..1}; do - echo -e "${BLUE}$i...${NC}" - sleep 1 -done -echo -e "\n" - -echo -e "${GREEN}🏃 Start Chatting...${NC}" -container_name=$(docker ps --format '{{.Names}}' | grep 'ollama') -docker exec -it $container_name ollama run llama2 \ No newline at end of file