Update Dockerfile
Browse files- Dockerfile +11 -13
Dockerfile
CHANGED
@@ -1,21 +1,19 @@
|
|
1 |
-
#
|
2 |
-
# We choose a version with Python 3.11 to match your previous environment
|
3 |
FROM nvcr.io/nvidia/pytorch:24.04-py3
|
4 |
|
5 |
-
# Set the working directory
|
6 |
WORKDIR /repository
|
7 |
|
8 |
-
#
|
9 |
-
|
|
|
10 |
|
11 |
-
#
|
12 |
-
|
13 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
14 |
|
15 |
-
# Copy the rest of your application code
|
16 |
COPY . .
|
17 |
|
18 |
-
#
|
19 |
-
|
20 |
-
|
21 |
-
# Your inference platform will typically handle the CMD or ENTRYPOINT
|
|
|
1 |
+
# 1. Start from the same great NVIDIA base image
|
|
|
2 |
FROM nvcr.io/nvidia/pytorch:24.04-py3
|
3 |
|
4 |
+
# 2. Set the working directory
|
5 |
WORKDIR /repository
|
6 |
|
7 |
+
# 3. Add Hugging Face specific environment variables
|
8 |
+
ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
|
9 |
+
ENV PORT=80
|
10 |
|
11 |
+
# 4. Copy and install requirements AND the HF toolkit
|
12 |
+
COPY requirements.txt .
|
13 |
+
RUN pip install --no-cache-dir -r requirements.txt huggingface_inference_toolkit
|
14 |
|
15 |
+
# 5. Copy the rest of your application code
|
16 |
COPY . .
|
17 |
|
18 |
+
# 6. THE CRUCIAL PART: Set the command to run the inference server
|
19 |
+
CMD ["python", "-m", "huggingface_inference_toolkit.main", "--model_dir", "."]
|
|
|
|