mail0000009 commited on
Commit
0c6428a
·
verified ·
1 Parent(s): c493a6e

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -0
Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ # Install build tools
4
+ RUN apt-get update && apt-get install -y build-essential python3-dev && rm -rf /var/lib/apt/lists/*
5
+
6
+ # Setup user
7
+ RUN useradd -m -u 1000 user
8
+ USER user
9
+ ENV HOME=/home/user \
10
+ PATH=/home/user/.local/bin:$PATH
11
+ WORKDIR $HOME/app
12
+
13
+ # Install requirements
14
+ COPY --chown=user requirements.txt .
15
+ RUN pip install --no-cache-dir -r requirements.txt
16
+
17
+ # Create model folder
18
+ RUN mkdir -p $HOME/app/models
19
+
20
+ # Expose HF port
21
+ EXPOSE 7860
22
+
23
+ # This command runs Llama 3.2 1B (Fast on CPU)
24
+ # and sets an API Key for security
25
+ CMD ["python3", "-m", "llama_cpp.server", \
26
+ "--model", "hf://bartowski/Llama-3.2-1B-Instruct-GGUF/Llama-3.2-1B-Instruct-Q4_K_M.gguf", \
27
+ "--host", "0.0.0.0", \
28
+ "--port", "7860", \
29
+ "--api_key", "my_secret_agent_key"]