kushagrasharma-13 commited on
Commit
a219f8f
·
1 Parent(s): 2c4b907

Adding Docker Container

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -10
Dockerfile CHANGED
@@ -3,20 +3,22 @@ FROM kushagrash13/qdrant_with_patent_database:latest
3
 
4
  # Install system dependencies
5
  RUN apt-get update && \
6
- apt-get install -y wget tar python3-pip
7
-
8
- # Install Qdrant
9
- RUN wget https://github.com/qdrant/qdrant/releases/download/v1.9.2/qdrant-x86_64-unknown-linux-gnu.tar.gz && \
10
- tar -xvf qdrant-x86_64-unknown-linux-gnu.tar.gz && \
11
- mv qdrant /usr/local/bin/qdrant && \
12
- rm qdrant-x86_64-unknown-linux-gnu.tar.gz
13
 
14
  # Set working directory
15
  WORKDIR /code
16
 
17
- # Copy requirements and install Python dependencies
18
  COPY ./requirements.txt /code/requirements.txt
19
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
 
 
 
 
 
 
20
 
21
  # Add a user and set environment variables
22
  RUN useradd -m -u 1000 user
@@ -31,4 +33,4 @@ WORKDIR $HOME/app
31
  COPY --chown=user . $HOME/app
32
 
33
  # Start Qdrant and the application
34
- CMD ["sh", "-c", "qdrant & sleep 10 && uvicorn app:app --host 0.0.0.0 --port 7860"]
 
3
 
4
  # Install system dependencies
5
  RUN apt-get update && \
6
+ apt-get install -y wget tar python3-pip python3-venv && \
7
+ rm -rf /var/lib/apt/lists/*
 
 
 
 
 
8
 
9
  # Set working directory
10
  WORKDIR /code
11
 
12
+ # Copy requirements file
13
  COPY ./requirements.txt /code/requirements.txt
14
+
15
+ # Create and activate a virtual environment
16
+ RUN python3 -m venv /venv
17
+ ENV PATH="/venv/bin:$PATH"
18
+ RUN /venv/bin/pip install --no-cache-dir --upgrade pip
19
+
20
+ # Install Python dependencies from requirements file
21
+ RUN /venv/bin/pip install --no-cache-dir --upgrade -r /code/requirements.txt
22
 
23
  # Add a user and set environment variables
24
  RUN useradd -m -u 1000 user
 
33
  COPY --chown=user . $HOME/app
34
 
35
  # Start Qdrant and the application
36
+ CMD ["sh", "-c", "qdrant & sleep 5 && uvicorn app:app --host 0.0.0.0 --port 7860"]