Vivek0912 commited on
Commit
b1f9cb5
·
1 Parent(s): ee01fe1

update docker

Browse files
Files changed (1) hide show
  1. backend/Dockerfile +7 -12
backend/Dockerfile CHANGED
@@ -2,23 +2,18 @@
2
  # Use the official Python 3.11.5 image
3
  FROM python:3.11.5
4
 
5
- EXPOSE 7860
6
-
7
- # Prevents Python from generating .pyc files and turns off buffering
8
- ENV PYTHONDONTWRITEBYTECODE=1
9
- ENV PYTHONUNBUFFERED=1
10
-
11
  # Set the working directory inside the container
12
  WORKDIR /app
13
 
14
- # Copy only the requirements file first (better for caching)
15
  COPY requirements.txt .
 
16
 
17
- # Install dependencies
18
- RUN python -m pip install --no-cache-dir -r requirements.txt
19
 
20
- # Copy the rest of the application code
21
- COPY . .
22
 
23
- # Run the FastAPI app with Gunicorn
24
  CMD ["gunicorn", "--bind", "0.0.0.0:7860", "-k", "uvicorn.workers.UvicornWorker", "main:app"]
 
2
  # Use the official Python 3.11.5 image
3
  FROM python:3.11.5
4
 
 
 
 
 
 
 
5
  # Set the working directory inside the container
6
  WORKDIR /app
7
 
8
+ # Copy requirements and install dependencies
9
  COPY requirements.txt .
10
+ RUN pip install --no-cache-dir -r requirements.txt
11
 
12
+ # Copy the backend code into the container
13
+ COPY . /app
14
 
15
+ # Expose port 7860 for FastAPI
16
+ EXPOSE 7860
17
 
18
+ # Run FastAPI using Uvicorn
19
  CMD ["gunicorn", "--bind", "0.0.0.0:7860", "-k", "uvicorn.workers.UvicornWorker", "main:app"]