Niansuh commited on
Commit
a99b7f4
·
verified ·
1 Parent(s): 6665b10

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -18
Dockerfile CHANGED
@@ -1,26 +1,11 @@
1
- # Use an official Python runtime as a parent image
2
  FROM python:3.10-slim
3
 
4
- # Install system dependencies
5
- RUN apt-get update && apt-get install -y --no-install-recommends \
6
- build-essential \
7
- && rm -rf /var/lib/apt/lists/*
8
-
9
- # Set the working directory in the container
10
  WORKDIR /app
11
 
12
- # Copy the requirements file first
13
- COPY requirements.txt /app/
14
 
15
- # Install dependencies
16
- RUN pip install --no-cache-dir --upgrade pip
17
  RUN pip install --no-cache-dir -r requirements.txt
18
 
19
- # Copy the current directory contents into the container
20
- COPY . /app
21
-
22
- # Expose the port that the FastAPI app runs on
23
- EXPOSE 8001
24
 
25
- # Command to run the app with Gunicorn and Uvicorn workers
26
- CMD ["gunicorn", "-k", "uvicorn.workers.UvicornWorker", "--workers", "8", "--bind", "0.0.0.0:8001", "main:app"]
 
 
1
  FROM python:3.10-slim
2
 
 
 
 
 
 
 
3
  WORKDIR /app
4
 
5
+ COPY requirements.txt .
 
6
 
 
 
7
  RUN pip install --no-cache-dir -r requirements.txt
8
 
9
+ COPY . .
 
 
 
 
10
 
11
+ CMD ["gunicorn", "-w", "4", "-k", "uvicorn.workers.UvicornWorker", "main:app", "--bind", "0.0.0.0:8001"]