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

moved docker file

Browse files
.dockerignore → backend/.dockerignore RENAMED
File without changes
Dockerfile → backend/Dockerfile RENAMED
@@ -4,20 +4,21 @@ FROM python:3.11.5
4
 
5
  EXPOSE 7860
6
 
7
- # Environment settings
8
  ENV PYTHONDONTWRITEBYTECODE=1
9
  ENV PYTHONUNBUFFERED=1
10
 
11
- # Install dependencies
 
 
 
12
  COPY requirements.txt .
13
- RUN python -m pip install --no-cache-dir -r requirements.txt
14
 
15
- # Set working directory
16
- WORKDIR /app
17
- COPY . /app
18
 
19
- # Ensure correct permissions (optional but recommended)
20
- RUN chown -R root:root /app
21
 
22
- # Start the FastAPI application
23
- CMD ["gunicorn", "--bind", "0.0.0.0:7860", "-k", "uvicorn.workers.UvicornWorker", "backend.main:app"]
 
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"]