banao-tech commited on
Commit
d327aa0
·
verified ·
1 Parent(s): 3d8571e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -19
Dockerfile CHANGED
@@ -2,27 +2,15 @@ FROM registry.hf.space/microsoft-omniparser:latest
2
 
3
  USER root
4
 
5
- # Set proper permissions for /tmp
6
- RUN chmod 1777 /tmp
7
-
8
- # Install CUDA dependencies and system packages
9
- RUN apt update -q && apt install -y --no-install-recommends \
10
- ca-certificates wget libgl1 \
11
  && wget -qO /tmp/cuda-keyring.deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb \
12
  && dpkg -i /tmp/cuda-keyring.deb && apt update -q \
13
- && apt install -y --no-install-recommends libcudnn8 libcublas-12-2 \
14
- && rm -rf /var/lib/apt/lists/* /tmp/cuda-keyring.deb
15
-
16
- # Install Python dependencies
17
- COPY requirements.txt requirements.txt
18
- RUN pip install --no-cache-dir -r requirements.txt
19
 
20
- # Copy application files
21
- COPY main.py main.py
22
- COPY weights.py weights.py
23
 
24
- # Expose application port
25
- EXPOSE 7860
26
 
27
- # Run weights.py and start the FastAPI server
28
- CMD ["bash", "-c", "python weights.py && uvicorn main:app --host 0.0.0.0 --port 7860"]
 
 
2
 
3
  USER root
4
 
5
+ RUN chmod 1777 /tmp \
6
+ && apt update -q && apt install -y ca-certificates wget libgl1 \
 
 
 
 
7
  && wget -qO /tmp/cuda-keyring.deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb \
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"]