cloudunity commited on
Commit
fce3e58
·
verified ·
1 Parent(s): f3c7569

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +42 -19
Dockerfile CHANGED
@@ -1,26 +1,49 @@
1
- FROM node:20-slim
2
 
3
- # Install ttyd + Python + basics
4
- RUN apt-get update && apt-get install -y \
5
- curl wget git build-essential ca-certificates python3 python3-pip \
6
- && curl -L https://github.com/tsl0922/ttyd/releases/latest/download/ttyd.x86_64 -o /usr/local/bin/ttyd \
7
- && chmod +x /usr/local/bin/ttyd \
8
- && apt-get clean && rm -rf /var/lib/apt/lists/*
9
 
10
- # Install Claude Code
11
- RUN npm install -g @anthropic-ai/claude-code
12
 
13
- # Install proxy dependencies
14
- RUN pip3 install --break-system-packages fastapi uvicorn httpx
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
- # Mount point for persistent bucket/storage
17
- RUN mkdir -p /data/workspace /data/claude-config
18
- WORKDIR /app
19
- COPY app.py /app/app.py
20
- COPY proxy.py /app/proxy.py
21
- COPY www /app/www
22
 
23
- # HF Spaces expects the app on port 7860
24
  EXPOSE 7860
25
 
26
- CMD ["python3", "app.py"]
 
 
1
+ FROM python:3.12-slim
2
 
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+ ENV PYTHONUNBUFFERED=1
5
+ ENV PIP_NO_CACHE_DIR=1
 
 
 
6
 
7
+ WORKDIR /app
 
8
 
9
+ RUN apt-get update && apt-get install -y --no-install-recommends \
10
+ git \
11
+ cmake \
12
+ build-essential \
13
+ curl \
14
+ ca-certificates \
15
+ libgomp1 \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+
19
+ # Build llama.cpp for CPU.
20
+ RUN git clone --depth 1 https://github.com/ggml-org/llama.cpp.git /tmp/llama.cpp \
21
+ && cmake -S /tmp/llama.cpp -B /tmp/llama.cpp/build \
22
+ -DGGML_NATIVE=OFF \
23
+ -DGGML_OPENMP=ON \
24
+ -DLLAMA_BUILD_SERVER=ON \
25
+ -DLLAMA_BUILD_TESTS=OFF \
26
+ -DLLAMA_BUILD_EXAMPLES=ON \
27
+ && cmake --build /tmp/llama.cpp/build \
28
+ --config Release \
29
+ --target llama-server \
30
+ -j2 \
31
+ && mkdir -p /opt/llama \
32
+ && cp /tmp/llama.cpp/build/bin/llama-server /opt/llama/llama-server \
33
+ && cp /tmp/llama.cpp/build/bin/*.so* /opt/llama/ 2>/dev/null || true \
34
+ && rm -rf /tmp/llama.cpp
35
+
36
+
37
+ # Hugging Face downloader.
38
+ RUN pip install --upgrade pip \
39
+ && pip install huggingface_hub
40
+
41
+
42
+ COPY start.sh /app/start.sh
43
+ RUN chmod +x /app/start.sh
44
 
 
 
 
 
 
 
45
 
 
46
  EXPOSE 7860
47
 
48
+
49
+ CMD ["/app/start.sh"]