madhwdh11 commited on
Commit
92b4c18
·
verified ·
1 Parent(s): a13d141

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -3
Dockerfile CHANGED
@@ -1,12 +1,20 @@
 
1
  FROM python:3.10-slim
2
 
3
- WORKDIR /app
 
4
 
5
- COPY main/ main/
 
 
 
6
  COPY requirements.txt .
7
 
 
8
  RUN pip install --no-cache-dir -r requirements.txt
9
 
 
10
  EXPOSE 7860
11
 
12
- CMD ["uvicorn", "main.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
+ # Use a slim Python base image
2
  FROM python:3.10-slim
3
 
4
+ # Set working dir into the 'main' folder
5
+ WORKDIR /app/main
6
 
7
+ # Copy only the contents of your app folder
8
+ COPY main/ .
9
+
10
+ # Copy requirements into the same dir
11
  COPY requirements.txt .
12
 
13
+ # Install deps
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
16
+ # Expose FastAPI port
17
  EXPOSE 7860
18
 
19
+ # Launch Uvicorn looking for "app" inside main.py
20
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]