Update Dockerfile
Browse files- Dockerfile +12 -7
Dockerfile
CHANGED
@@ -1,21 +1,26 @@
|
|
1 |
-
FROM python:3.9
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
4 |
|
5 |
-
|
|
|
|
|
6 |
|
|
|
|
|
7 |
ENV PATH="/home/user/.local/bin:$PATH"
|
8 |
-
|
9 |
WORKDIR /app
|
10 |
|
11 |
-
# Download
|
12 |
RUN wget https://huggingface.co/cigol123/YugoGPT-Q4_0-GGUF/resolve/main/yugogpt-q4_0.gguf
|
13 |
|
14 |
COPY --chown=user ./requirements.txt requirements.txt
|
15 |
-
|
16 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
17 |
|
18 |
COPY --chown=user . /app
|
19 |
-
|
20 |
CMD ["python", "app.py"]
|
21 |
|
|
|
1 |
+
FROM python:3.9-slim
|
2 |
|
3 |
+
# Install build essentials for llama-cpp-python
|
4 |
+
RUN apt-get update && apt-get install -y \
|
5 |
+
build-essential \
|
6 |
+
wget \
|
7 |
+
&& rm -rf /var/lib/apt/lists/*
|
8 |
|
9 |
+
# Set environment variables for llama-cpp optimizations
|
10 |
+
ENV CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS -DLLAMA_AVX=ON -DLLAMA_AVX2=ON -DLLAMA_F16C=ON -DLLAMA_FMA=ON"
|
11 |
+
ENV FORCE_CMAKE=1
|
12 |
|
13 |
+
RUN useradd -m -u 1000 user
|
14 |
+
USER user
|
15 |
ENV PATH="/home/user/.local/bin:$PATH"
|
|
|
16 |
WORKDIR /app
|
17 |
|
18 |
+
# Download model
|
19 |
RUN wget https://huggingface.co/cigol123/YugoGPT-Q4_0-GGUF/resolve/main/yugogpt-q4_0.gguf
|
20 |
|
21 |
COPY --chown=user ./requirements.txt requirements.txt
|
|
|
22 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
23 |
|
24 |
COPY --chown=user . /app
|
|
|
25 |
CMD ["python", "app.py"]
|
26 |
|