mikmc5 commited on
Commit
77832f3
·
verified ·
1 Parent(s): c03c6ce

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -7
Dockerfile CHANGED
@@ -1,20 +1,20 @@
1
- # Use a lightweight Python image
2
  FROM python:3.9-slim
3
 
4
- # Set working directory
5
  WORKDIR /app
6
 
7
- # Copy dependencies
8
  COPY requirements.txt .
9
 
10
  # Install dependencies
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
- # Copy application files
14
  COPY . .
15
 
16
- # Expose the port the FastAPI app will run on
17
  EXPOSE 8000
18
 
19
- # Start the FastAPI app with Uvicorn
20
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
 
1
+ # Use the official Python base image
2
  FROM python:3.9-slim
3
 
4
+ # Set the working directory inside the container
5
  WORKDIR /app
6
 
7
+ # Copy the requirements file to the working directory
8
  COPY requirements.txt .
9
 
10
  # Install dependencies
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
+ # Copy the application content to the working directory
14
  COPY . .
15
 
16
+ # Expose the port on which the application will run (FastAPI default is 8000)
17
  EXPOSE 8000
18
 
19
+ # Start the application using Gunicorn
20
+ CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:8000", "--log-level", "debug", "--access-logfile", "-"]