AIencoder commited on
Commit
2d07114
·
verified ·
1 Parent(s): d2dc2bf

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -21
Dockerfile CHANGED
@@ -1,38 +1,28 @@
1
  FROM python:3.11-slim
2
 
3
- # Install system dependencies
4
  RUN apt-get update && apt-get install -y \
5
  curl \
6
  ca-certificates \
7
- procps \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
- # Install Ollama
11
- RUN curl -fsSL https://ollama.ai/install.sh | sh
12
 
13
- # Install Python packages
14
- RUN pip install --no-cache-dir \
15
- gradio>=4.0.0 \
16
- requests
17
-
18
- # Create non-root user (required for HF Spaces)
19
  RUN useradd -m -u 1000 user
20
- USER user
21
 
22
- ENV HOME=/home/user
23
- ENV PATH="/home/user/.local/bin:$PATH"
24
- ENV OLLAMA_HOST=0.0.0.0
25
- ENV OLLAMA_MODELS=/home/user/.ollama/models
26
- ENV GRADIO_SERVER_NAME=0.0.0.0
27
- ENV GRADIO_SERVER_PORT=7860
28
 
 
 
29
  WORKDIR $HOME/app
30
 
31
- # Copy application files
32
- COPY --chown=user . $HOME/app
 
 
 
33
 
34
  RUN chmod +x entrypoint.sh
35
 
36
- EXPOSE 7860 11434
37
 
38
- CMD ["./entrypoint.sh"]
 
1
  FROM python:3.11-slim
2
 
 
3
  RUN apt-get update && apt-get install -y \
4
  curl \
5
  ca-certificates \
 
6
  && rm -rf /var/lib/apt/lists/*
7
 
8
+ RUN pip install --no-cache-dir gradio requests
 
9
 
 
 
 
 
 
 
10
  RUN useradd -m -u 1000 user
 
11
 
12
+ RUN curl -fsSL https://ollama.com/install.sh | sh
 
 
 
 
 
13
 
14
+ USER user
15
+ ENV HOME=/home/user
16
  WORKDIR $HOME/app
17
 
18
+ ENV OLLAMA_HOST=0.0.0.0
19
+ ENV OLLAMA_MODELS=$HOME/.ollama/models
20
+
21
+ COPY --chown=user:user app.py .
22
+ COPY --chown=user:user entrypoint.sh .
23
 
24
  RUN chmod +x entrypoint.sh
25
 
26
+ EXPOSE 7860
27
 
28
+ CMD ["bash", "entrypoint.sh"]