banao-tech commited on
Commit
c88d5f7
·
verified ·
1 Parent(s): 299bb75

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -11
Dockerfile CHANGED
@@ -1,23 +1,22 @@
1
- # Authenticate to Hugging Face Docker registry
2
- ARG HF_TOKEN
3
- ARG HF_USERNAME
4
- FROM alpine:latest as auth
5
- RUN apk add --no-cache docker-cli
6
- RUN echo "$HF_TOKEN" | docker login registry.huggingface.co -u $HF_USERNAME --password-stdin
7
-
8
- FROM registry.hf.space/microsoft-omniparser:latest
9
 
 
10
  USER root
11
 
 
12
  RUN chmod 1777 /tmp \
13
  && apt update -q && apt install -y ca-certificates wget libgl1 \
14
  && wget -qO /tmp/cuda-keyring.deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb \
15
  && dpkg -i /tmp/cuda-keyring.deb && apt update -q \
16
  && apt install -y --no-install-recommends libcudnn8 libcublas-12-2
17
 
 
18
  RUN pip install fastapi[all]
19
 
 
 
 
20
 
21
- COPY main.py main.py
22
- RUN python main.py
23
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use the correct Hugging Face container
2
+ FROM registry.huggingface.co/microsoft/omniparser:latest
 
 
 
 
 
 
3
 
4
+ # Switch to root user for package installation
5
  USER root
6
 
7
+ # Install system dependencies
8
  RUN chmod 1777 /tmp \
9
  && apt update -q && apt install -y ca-certificates wget libgl1 \
10
  && wget -qO /tmp/cuda-keyring.deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb \
11
  && dpkg -i /tmp/cuda-keyring.deb && apt update -q \
12
  && apt install -y --no-install-recommends libcudnn8 libcublas-12-2
13
 
14
+ # Install required Python packages
15
  RUN pip install fastapi[all]
16
 
17
+ # Ensure main.py exists in the same directory as the Dockerfile
18
+ COPY main.py /app/main.py
19
+ WORKDIR /app
20
 
21
+ # Run the script
22
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]