Leon4gr45 commited on
Commit
fe7c322
·
verified ·
1 Parent(s): 9de0105

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -15
Dockerfile CHANGED
@@ -1,24 +1,22 @@
1
- # 1. Start from a community-vetted, GPU-ready image
2
- FROM runpod/pytorch:2.2.0-py3.10-cuda12.1.1-devel
 
3
 
4
- # 2. Set up the environment
5
- ENV DEBIAN_FRONTEND=noninteractive
6
- ENV HF_HOME="/data/huggingface"
7
- ENV UV_CACHE_DIR="/data/uv_cache"
8
 
9
- # 3. The base image already has python, pip, etc. Install uv.
10
- RUN pip install uv
 
 
 
11
 
12
- # 4. Copy requirements and install them.
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
- # 6. Expose the port.
21
  EXPOSE 7860
22
 
23
- # 7. Run the application with uvicorn.
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"]