AItool commited on
Commit
8d31667
·
verified ·
1 Parent(s): fa6a0d9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -7
Dockerfile CHANGED
@@ -1,20 +1,22 @@
1
  FROM python:3.11-slim
2
 
3
- # 1) set up workdir + system deps (if any)
 
 
4
  WORKDIR /app
5
 
6
- # 2) copy your library subtree
7
- COPY python-fasthtml ./python-fasthtml
8
 
9
- # 3) install your library first
10
  RUN pip install --no-cache-dir ./python-fasthtml
11
 
12
- # 4) copy rest of project
13
  COPY requirements.txt .
14
  COPY main.py .
15
 
16
- # 5) install all other deps
17
- # (remove python-fasthtml from requirements.txt)
18
  RUN pip install --no-cache-dir -r requirements.txt
19
 
20
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
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"]