Create Dockerfile
Browse files- Dockerfile +20 -0
Dockerfile
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.11
|
2 |
+
RUN apt-get update && apt-get install -y \
|
3 |
+
build-essential \
|
4 |
+
libopenblas-dev \
|
5 |
+
libomp-dev \
|
6 |
+
&& rm -rf /var/lib/apt/lists/*
|
7 |
+
RUN useradd -m -u 1000 user
|
8 |
+
USER user
|
9 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
10 |
+
WORKDIR /app
|
11 |
+
|
12 |
+
|
13 |
+
RUN pip --no-cache-dir install requests fastapi uvicorn[standard]==0.17.* transformers torch accelerate
|
14 |
+
run CMAKE_ARGS="-DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
|
15 |
+
|
16 |
+
RUN cat /proc/cpuinfo
|
17 |
+
|
18 |
+
COPY --chown=user . /app
|
19 |
+
|
20 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|