Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +17 -4
Dockerfile
CHANGED
@@ -1,7 +1,20 @@
|
|
1 |
FROM python:3.11-slim
|
|
|
|
|
2 |
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
COPY requirements.txt .
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
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"]
|