banao-tech commited on
Commit
fde91a4
·
verified ·
1 Parent(s): 6f1a437

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -5
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM registry.huggingface.co/spaces/microsoft/omniparser:latest
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
- RUN pip install fastapi[all]
12
-
13
 
 
14
  COPY main.py main.py
15
- RUN python main.py
16
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
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"]