Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +10 -5
Dockerfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
FROM
|
2 |
|
3 |
USER root
|
4 |
|
@@ -8,9 +8,14 @@ RUN chmod 1777 /tmp \
|
|
8 |
&& dpkg -i /tmp/cuda-keyring.deb && apt update -q \
|
9 |
&& apt install -y --no-install-recommends libcudnn8 libcublas-12-2
|
10 |
|
11 |
-
|
12 |
-
|
13 |
|
|
|
14 |
COPY main.py main.py
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.10 # Use Python instead of missing omniparser image
|
2 |
|
3 |
USER root
|
4 |
|
|
|
8 |
&& dpkg -i /tmp/cuda-keyring.deb && apt update -q \
|
9 |
&& apt install -y --no-install-recommends libcudnn8 libcublas-12-2
|
10 |
|
11 |
+
# Install FastAPI and other Python dependencies
|
12 |
+
RUN pip install fastapi[all] uvicorn
|
13 |
|
14 |
+
# Copy application code
|
15 |
COPY main.py main.py
|
16 |
+
|
17 |
+
# Run Python script to check for errors before starting FastAPI
|
18 |
+
RUN python main.py
|
19 |
+
|
20 |
+
# Start FastAPI server
|
21 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|