Spaces:
Sleeping
Sleeping
Damien Benveniste
commited on
Commit
·
e1996ec
1
Parent(s):
10dd1af
modified
Browse files- Dockerfile +48 -48
Dockerfile
CHANGED
@@ -1,62 +1,62 @@
|
|
1 |
-
# Use the official vLLM image as the base image
|
2 |
-
FROM vllm/vllm-openai:latest
|
3 |
-
|
4 |
-
# Install debugging tools
|
5 |
-
RUN apt-get update && apt-get install -y procps vim
|
6 |
-
|
7 |
-
# Set environment variables
|
8 |
-
ENV HUGGING_FACE_HUB_TOKEN="your_hf_token_here"
|
9 |
-
ENV HF_HOME="/tmp/huggingface"
|
10 |
-
ENV XDG_CACHE_HOME="/tmp/cache"
|
11 |
-
ENV NUMBA_CACHE_DIR="/tmp/numba_cache"
|
12 |
-
ENV OUTLINES_CACHE_DIR="/tmp/outlines_cache"
|
13 |
-
ENV VLLM_USE_MODELSCOPE="false"
|
14 |
-
ENV VLLM_DISABLE_USAGE_STATS="true"
|
15 |
-
ENV XDG_CONFIG_HOME="/tmp/config"
|
16 |
-
|
17 |
-
# Ensure PATH includes common Python locations
|
18 |
-
ENV PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:$PATH"
|
19 |
-
|
20 |
-
# Set the working directory
|
21 |
-
WORKDIR /app
|
22 |
|
23 |
-
#
|
24 |
-
|
25 |
-
RUN chmod +x /app/entrypoint.sh
|
26 |
|
27 |
-
#
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
-
#
|
31 |
-
|
32 |
|
33 |
-
#
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
-
# #
|
36 |
-
#
|
37 |
|
38 |
-
# # Set the
|
39 |
-
#
|
40 |
|
41 |
-
|
42 |
-
# RUN pip install --no-cache-dir vllm
|
43 |
|
44 |
-
#
|
45 |
-
|
46 |
|
47 |
-
#
|
48 |
-
|
49 |
|
50 |
-
#
|
51 |
-
|
52 |
|
53 |
-
#
|
54 |
-
|
55 |
|
56 |
-
#
|
57 |
-
|
58 |
|
59 |
-
#
|
|
|
60 |
|
61 |
-
#
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# # Use the official vLLM image as the base image
|
2 |
+
# FROM vllm/vllm-openai:latest
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
+
# # Install debugging tools
|
5 |
+
# RUN apt-get update && apt-get install -y procps vim
|
|
|
6 |
|
7 |
+
# # Set environment variables
|
8 |
+
# ENV HUGGING_FACE_HUB_TOKEN="your_hf_token_here"
|
9 |
+
# ENV HF_HOME="/tmp/huggingface"
|
10 |
+
# ENV XDG_CACHE_HOME="/tmp/cache"
|
11 |
+
# ENV NUMBA_CACHE_DIR="/tmp/numba_cache"
|
12 |
+
# ENV OUTLINES_CACHE_DIR="/tmp/outlines_cache"
|
13 |
+
# ENV VLLM_USE_MODELSCOPE="false"
|
14 |
+
# ENV VLLM_DISABLE_USAGE_STATS="true"
|
15 |
+
# ENV XDG_CONFIG_HOME="/tmp/config"
|
16 |
|
17 |
+
# # Ensure PATH includes common Python locations
|
18 |
+
# ENV PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:$PATH"
|
19 |
|
20 |
+
# # Set the working directory
|
21 |
+
# WORKDIR /app
|
22 |
+
|
23 |
+
# # Copy your entrypoint script
|
24 |
+
# COPY entrypoint.sh /app/entrypoint.sh
|
25 |
+
# RUN chmod +x /app/entrypoint.sh
|
26 |
|
27 |
+
# # Expose the port the app runs on
|
28 |
+
# EXPOSE 8000
|
29 |
|
30 |
+
# # Set the entrypoint
|
31 |
+
# ENTRYPOINT ["/app/entrypoint.sh"]
|
32 |
|
33 |
+
FROM python:3.9
|
|
|
34 |
|
35 |
+
# Create a non-root user
|
36 |
+
RUN useradd -m -u 1000 user
|
37 |
|
38 |
+
# Set the working directory in the container
|
39 |
+
WORKDIR /app
|
40 |
|
41 |
+
# Install vLLM
|
42 |
+
RUN pip install --no-cache-dir vllm
|
43 |
|
44 |
+
# Copy the entrypoint script
|
45 |
+
COPY entrypoint.sh /app/entrypoint.sh
|
46 |
|
47 |
+
# Change ownership of the working directory and entrypoint script to the non-root user
|
48 |
+
RUN chown -R user:user /app
|
49 |
|
50 |
+
# Change permissions of the entrypoint script
|
51 |
+
RUN chmod +x /app/entrypoint.sh
|
52 |
|
53 |
+
# Switch to the non-root user
|
54 |
+
USER user
|
55 |
+
|
56 |
+
# Set the PATH for the non-root user
|
57 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
58 |
+
|
59 |
+
EXPOSE 8000
|
60 |
+
|
61 |
+
# Set the entrypoint
|
62 |
+
ENTRYPOINT ["/app/entrypoint.sh"]
|