Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +4 -20
Dockerfile
CHANGED
@@ -1,34 +1,18 @@
|
|
1 |
# Set up base image (use the correct Hugging Face registry)
|
2 |
-
FROM registry.
|
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 |
-
|
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 |
-
|
|
|
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"]
|