From 3743ef63a03f83c1bba0ab3fbf81ad3e834e8e02 Mon Sep 17 00:00:00 2001 From: Naman joshi <100407963+Naman9761@users.noreply.github.com> Date: Fri, 18 Oct 2024 17:57:53 +0530 Subject: [PATCH 1/2] Created Dockerfile Create the docker file to make the OmAgent not dependent of any particular os or any particular version of any liberary. --- Dockerfile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0863153 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# Use an official Python runtime as a parent image +FROM python:3.10-slim + +# Set the working directory in the container +WORKDIR /app + +# Copy the current directory contents into the container +COPY . /app + +# Install omagent_core as an editable package +RUN pip install -e omagent-core + +# Install all other dependencies +RUN pip install -r requirements.txt + +# Expose a port to allow external connections to the container +EXPOSE 8000 + +# Run the application +CMD ["python", "run.py"] From cb6e78800369db425ab307cc00ade113bcaef7e0 Mon Sep 17 00:00:00 2001 From: Naman joshi <100407963+Naman9761@users.noreply.github.com> Date: Fri, 18 Oct 2024 18:00:29 +0530 Subject: [PATCH 2/2] Create docker-compose.yml Created the docker-compose file to build the docker container and run the app in the machine --- docker-compose.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..8d427ad --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,32 @@ +version: '3' + +services: + omagent: + build: . + container_name: omagent_app + ports: + - "8000:8000" # Expose app's default port + volumes: + - .:/app # Mount the project directory + environment: + custom_openai_endpoint: "your_openai_endpoint" + custom_openai_key: "your_openai_key" + bing_api_key: "your_bing_key" + ovd_endpoint: "http://milvus:8000/inf_predict" # Point to the Milvus service + ovd_model_id: "OmDet-Turbo_tiny_SWIN_T" + depends_on: + - milvus + command: python run.py # Run the main script + + milvus: + image: milvusdb/milvus:v2.3.0 + container_name: milvus + ports: + - "19530:19530" # Milvus default port for vector database communication + environment: + MILVUS_MODE: "standalone" + volumes: + - milvus_data:/var/lib/milvus + +volumes: + milvus_data: {}