Create Dockerfile
Browse files- Dockerfile +20 -0
Dockerfile
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use Hugging Face TGI as the base image
|
| 2 |
+
FROM ghcr.io/huggingface/text-generation-inference:3.0.2
|
| 3 |
+
|
| 4 |
+
# Set working directory
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Create and set permissions for cache directories
|
| 8 |
+
RUN mkdir -p /data && chmod 777 /data
|
| 9 |
+
RUN mkdir -p /.cache && chmod 777 /.cache
|
| 10 |
+
RUN mkdir -p /.triton && chmod 777 /.triton
|
| 11 |
+
|
| 12 |
+
# Expose the model API on port 8080
|
| 13 |
+
EXPOSE 8080
|
| 14 |
+
|
| 15 |
+
# Set Hugging Face token for private models
|
| 16 |
+
ARG HF_TOKEN
|
| 17 |
+
ENV HF_TOKEN=${HF_TOKEN}
|
| 18 |
+
|
| 19 |
+
# Run the TGI server with Mistral 7B
|
| 20 |
+
CMD ["--model-id", "mistralai/Mistral-7B-v0.3", "--port", "8080"]
|