Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +16 -11
Dockerfile
CHANGED
|
@@ -1,15 +1,20 @@
|
|
| 1 |
-
FROM
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
-
RUN
|
| 6 |
-
&&
|
| 7 |
-
&& unzip /tmp/xray.zip -d /tmp/xray \
|
| 8 |
-
&& mv /tmp/xray/xray /usr/local/bin/xray \
|
| 9 |
-
&& chmod +x /usr/local/bin/xray \
|
| 10 |
-
&& rm -rf /tmp/xray /tmp/xray.zip
|
| 11 |
|
| 12 |
-
COPY
|
| 13 |
-
RUN chmod +x /start.sh
|
| 14 |
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
| 2 |
|
| 3 |
+
WORKDIR /app
|
| 4 |
|
| 5 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 6 |
+
build-essential cmake git ninja-build && rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
+
COPY . .
|
|
|
|
| 9 |
|
| 10 |
+
ENV CMAKE_BUILD_PARALLEL_LEVEL=4
|
| 11 |
+
ENV FORCE_CMAKE=1
|
| 12 |
+
|
| 13 |
+
RUN pip install --no-cache-dir fastapi uvicorn pydantic huggingface_hub
|
| 14 |
+
RUN pip install --no-cache-dir --prefer-binary \
|
| 15 |
+
llama-cpp-python \
|
| 16 |
+
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
| 17 |
+
|
| 18 |
+
ENV HF_HOME=/app/hf_cache
|
| 19 |
+
EXPOSE 7860
|
| 20 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|