Tom716 commited on
Commit
84c0a7e
·
verified ·
1 Parent(s): 8d56f50

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -0
Dockerfile ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ # 1. Install standard tools (curl needed for Ollama install)
4
+ RUN apt-get update && apt-get install -y \
5
+ curl \
6
+ && rm -rf /var/lib/apt/lists/*
7
+
8
+ # 2. Install Ollama (Official Script)
9
+ RUN curl -fsSL https://ollama.com/install.sh | sh
10
+
11
+ # 3. Create a non-root user (Required for HF Spaces Security)
12
+ RUN useradd -m -u 1000 user
13
+ USER user
14
+ ENV HOME=/home/user \
15
+ PATH=/home/user/.local/bin:$PATH
16
+
17
+ # 4. Set up the working directory
18
+ WORKDIR $HOME/app
19
+
20
+ # 5. Copy your files into the container
21
+ COPY --chown=user . $HOME/app
22
+
23
+ # 6. Install Python dependencies
24
+ RUN pip install --no-cache-dir -r requirements.txt
25
+
26
+ # 7. Open the port Gradio uses
27
+ EXPOSE 7860
28
+
29
+ # 8. Run your app
30
+ CMD ["python", "app.py"]