patrickbdevaney commited on
Commit
f3b6736
1 Parent(s): 6e945e4

new dockerf

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -2
Dockerfile CHANGED
@@ -11,15 +11,24 @@ WORKDIR /usr/src/swarms
11
  # Copy the requirements file and pyproject.toml to the container
12
  COPY pyproject.toml requirements.txt ./
13
 
14
- # Install Python dependencies
15
  RUN pip install --upgrade pip
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
 
 
 
 
18
  # Copy the rest of the application files from the root (not inside swarms/)
19
  COPY . .
20
 
 
 
 
 
 
21
  # Expose the port for FastAPI
22
  EXPOSE 8000
23
 
24
  # Command to run the FastAPI app using Uvicorn
25
- CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
 
11
  # Copy the requirements file and pyproject.toml to the container
12
  COPY pyproject.toml requirements.txt ./
13
 
14
+ # Install Python dependencies from requirements.txt
15
  RUN pip install --upgrade pip
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
+ # Check if uvicorn is already in the requirements.txt, if not install it
19
+ # This ensures uvicorn is installed without duplicates
20
+ RUN pip show uvicorn || pip install uvicorn
21
+
22
  # Copy the rest of the application files from the root (not inside swarms/)
23
  COPY . .
24
 
25
+ # Verify installations (helpful for debugging)
26
+ RUN python --version
27
+ RUN pip show uvicorn
28
+ RUN which uvicorn
29
+
30
  # Expose the port for FastAPI
31
  EXPOSE 8000
32
 
33
  # Command to run the FastAPI app using Uvicorn
34
+ CMD ["python", "-m", "uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]