AItool commited on
Commit
306cef0
·
verified ·
1 Parent(s): 23cf9c3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -12
Dockerfile CHANGED
@@ -1,22 +1,24 @@
 
1
  FROM python:3.11-slim
2
 
3
- # (optional) upgrade pip first
4
  RUN pip install --no-cache-dir --upgrade pip setuptools wheel
5
 
 
6
  WORKDIR /app
7
 
8
- # 1) copy only your wheel/package folder
9
- #COPY python-fasthtml/ ./python-fasthtml/
10
 
11
- # 2) install the local package
12
- #RUN pip install --no-cache-dir ./python-fasthtml
 
13
 
14
- # 3) copy rest of the app
15
- COPY requirements.txt .
16
- COPY main.py .
17
-
18
- # 4) install remaining deps
19
- # make sure requirements.txt no longer lists python-fasthtml
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
22
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
1
+ # 1) Start from a small Python base
2
  FROM python:3.11-slim
3
 
4
+ # 2) Upgrade pip, setuptools, wheel (avoids old‐pip bugs)
5
  RUN pip install --no-cache-dir --upgrade pip setuptools wheel
6
 
7
+ # 3) Set the working dir
8
  WORKDIR /app
9
 
10
+ # 4) Copy your entire repo into the container
11
+ COPY . .
12
 
13
+ # 5) Install your local package from src/ first
14
+ # (assumes src/ has a setup.py or pyproject.toml at its root)
15
+ RUN pip install --no-cache-dir ./src
16
 
17
+ # 6) Now install all the other deps
 
 
 
 
 
18
  RUN pip install --no-cache-dir -r requirements.txt
19
 
20
+ # 7) Expose the port your app uses
21
+ EXPOSE 5001
22
+
23
+ # 8) Launch FastAPI via Uvicorn
24
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "5001"]