Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +13 -15
Dockerfile
CHANGED
@@ -1,24 +1,22 @@
|
|
1 |
-
# 1. Start from
|
2 |
-
|
|
|
3 |
|
4 |
-
# 2.
|
5 |
-
|
6 |
-
ENV HF_HOME="/data/huggingface"
|
7 |
-
ENV UV_CACHE_DIR="/data/uv_cache"
|
8 |
|
9 |
-
# 3.
|
10 |
-
|
|
|
|
|
|
|
11 |
|
12 |
-
# 4. Copy
|
13 |
-
COPY requirements.txt .
|
14 |
-
RUN uv pip install --no-cache --system -r requirements.txt
|
15 |
-
|
16 |
-
# 5. Copy the application code.
|
17 |
COPY ./app.py /app/app.py
|
18 |
WORKDIR /app
|
19 |
|
20 |
-
#
|
21 |
EXPOSE 7860
|
22 |
|
23 |
-
#
|
24 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
+
# 1. Start from the official vLLM OpenAI-compatible image.
|
2 |
+
# This image is guaranteed to have the correct vLLM and CUDA dependencies.
|
3 |
+
FROM vllm/vllm-openai:latest
|
4 |
|
5 |
+
# 2. Override the default entrypoint of the base image so we can run our own code.
|
6 |
+
ENTRYPOINT []
|
|
|
|
|
7 |
|
8 |
+
# 3. Install the extra packages needed for our custom Gradio UI.
|
9 |
+
# The base image already contains vllm, fastapi, pydantic, and torch.
|
10 |
+
RUN pip3 install --no-cache-dir \
|
11 |
+
gradio==4.31.0 \
|
12 |
+
uvicorn
|
13 |
|
14 |
+
# 4. Copy our custom application file.
|
|
|
|
|
|
|
|
|
15 |
COPY ./app.py /app/app.py
|
16 |
WORKDIR /app
|
17 |
|
18 |
+
# 5. Expose the port our app will run on.
|
19 |
EXPOSE 7860
|
20 |
|
21 |
+
# 6. Define the command to run our combined FastAPI/Gradio application using uvicorn.
|
22 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|