banao-tech commited on
Commit
aea973c
·
verified ·
1 Parent(s): ca993e7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -20
Dockerfile CHANGED
@@ -1,34 +1,18 @@
1
  # Set up base image (use the correct Hugging Face registry)
2
- FROM registry.huggingface.co/microsoft-omniparser:v2
3
 
4
- # Set environment variables for authentication (persist across layers)
5
- ARG HF_TOKEN
6
- ARG HF_USERNAME
7
- ENV HF_TOKEN=${HF_TOKEN}
8
- ENV HF_USERNAME=${HF_USERNAME}
9
 
10
- # Authenticate with Hugging Face's Docker registry
11
- RUN echo "$HF_TOKEN" | docker login registry.huggingface.co -u "$HF_USERNAME" --password-stdin
12
-
13
- # Switch to root user for package installation
14
  USER root
15
 
16
- # Install system dependencies
17
  RUN chmod 1777 /tmp \
18
  && apt update -q && apt install -y ca-certificates wget libgl1 \
19
  && wget -qO /tmp/cuda-keyring.deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb \
20
  && dpkg -i /tmp/cuda-keyring.deb && apt update -q \
21
  && apt install -y --no-install-recommends libcudnn8 libcublas-12-2
22
 
23
- # Install required Python packages
24
- RUN pip install fastapi[all]
25
-
26
- # Create the application directory
27
- RUN mkdir -p /app
28
- WORKDIR /app
29
 
30
- # Copy application files
31
- COPY main.py /app/main.py
32
 
33
- # Set entry point to run the FastAPI server
 
34
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  # Set up base image (use the correct Hugging Face registry)
2
+ FROM registry.hf.space/microsoft-omniparser:latest
3
 
 
 
 
 
 
4
 
 
 
 
 
5
  USER root
6
 
 
7
  RUN chmod 1777 /tmp \
8
  && apt update -q && apt install -y ca-certificates wget libgl1 \
9
  && wget -qO /tmp/cuda-keyring.deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb \
10
  && dpkg -i /tmp/cuda-keyring.deb && apt update -q \
11
  && apt install -y --no-install-recommends libcudnn8 libcublas-12-2
12
 
13
+ RUN pip install fastapi[all]
 
 
 
 
 
14
 
 
 
15
 
16
+ COPY main.py main.py
17
+ RUN python main.py
18
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]