Drakkarious commited on
Commit
b7bb791
·
verified ·
1 Parent(s): 4d19bbd

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -12
Dockerfile CHANGED
@@ -1,30 +1,31 @@
1
- FROM python:3.10-slim
2
 
3
- # Install system dependencies
4
- RUN apt-get update && apt-get install -y curl git && rm -rf /var/lib/apt/lists/*
 
 
 
 
5
 
6
- # Set up user and environment
7
  RUN useradd -m -u 1000 user
8
  ENV HOME=/home/user \
9
  PATH=/home/user/.local/bin:$PATH
10
-
11
  WORKDIR $HOME/app
12
 
13
- # Pre-create cache directory with correct permissions
14
  RUN mkdir -p $HOME/app/model_cache && chown -R user:user $HOME/app
15
-
16
  USER user
17
 
18
- # Install libraries (using the pre-compiled wheel for llama-cpp)
19
  RUN pip install --no-cache-dir \
20
  https://github.com/mrzeeshanahmed/llama-cpp-python/releases/download/v0.3.17-manylinux-x86_64/llama_cpp_python-0.3.17-cp310-cp310-manylinux_2_17_x86_64.whl \
21
  huggingface-hub \
22
  hf-transfer \
23
- ipython \
24
  numpy
25
 
26
- # Copy application files
27
  COPY --chown=user . .
28
 
29
- # Run the script
30
- CMD ["python", "app.py"]
 
1
+ FROM python:3.10-bookworm
2
 
3
+ # Install essential build tools just in case
4
+ RUN apt-get update && apt-get install -y \
5
+ curl \
6
+ git \
7
+ procps \
8
+ && rm -rf /var/lib/apt/lists/*
9
 
10
+ # Standard Hugging Face user setup
11
  RUN useradd -m -u 1000 user
12
  ENV HOME=/home/user \
13
  PATH=/home/user/.local/bin:$PATH
 
14
  WORKDIR $HOME/app
15
 
16
+ # Pre-create and set permissions
17
  RUN mkdir -p $HOME/app/model_cache && chown -R user:user $HOME/app
 
18
  USER user
19
 
20
+ # Install the wheel and core tools
21
  RUN pip install --no-cache-dir \
22
  https://github.com/mrzeeshanahmed/llama-cpp-python/releases/download/v0.3.17-manylinux-x86_64/llama_cpp_python-0.3.17-cp310-cp310-manylinux_2_17_x86_64.whl \
23
  huggingface-hub \
24
  hf-transfer \
 
25
  numpy
26
 
27
+ # Copy files
28
  COPY --chown=user . .
29
 
30
+ # Use -u for unbuffered logs so you see progress in real-time
31
+ CMD ["python", "-u", "app.py"]