proti0070 commited on
Commit
ad46b6a
Β·
verified Β·
1 Parent(s): 209b674

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +73 -11
Dockerfile CHANGED
@@ -1,16 +1,78 @@
1
- # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
- # you will also find guides on how best to write your Dockerfile
3
 
4
- FROM python:3.9
 
5
 
6
- RUN useradd -m -u 1000 user
7
- USER user
8
- ENV PATH="/home/user/.local/bin:$PATH"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
- WORKDIR /app
 
11
 
12
- COPY --chown=user ./requirements.txt requirements.txt
13
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
 
 
 
14
 
15
- COPY --chown=user . /app
16
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM kalilinux/kali-rolling
 
2
 
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+ ENV HOSTNAME=xro
5
 
6
+ # ── System packages ───────────────────────────────────────────────────────────
7
+ RUN apt-get update && apt-get install -y \
8
+ ca-certificates \
9
+ curl \
10
+ wget \
11
+ git \
12
+ sudo \
13
+ htop \
14
+ btop \
15
+ neovim \
16
+ nano \
17
+ tmux \
18
+ screen \
19
+ lsof \
20
+ net-tools \
21
+ nmap \
22
+ netcat-traditional \
23
+ whois \
24
+ dnsutils \
25
+ python3 \
26
+ python3-pip \
27
+ python3-full \
28
+ libssl-dev \
29
+ libffi-dev \
30
+ nodejs \
31
+ npm \
32
+ nginx \
33
+ dbus \
34
+ && rm -rf /var/lib/apt/lists/*
35
 
36
+ # ── Node v22 ─────────────────────────────────────────────────────────────────
37
+ RUN npm install -g n && n 22 && hash -r
38
 
39
+ # ── Python deps (FastAPI server) ──────────────────────────────────────────────
40
+ RUN pip3 install --break-system-packages \
41
+ fastapi \
42
+ "uvicorn[standard]" \
43
+ httpx
44
 
45
+ # ── ttyd ─────────────────────────────────────────────────────────────────────
46
+ RUN curl -fsSL https://github.com/tsl0922/ttyd/releases/download/1.7.4/ttyd.x86_64 \
47
+ -o /usr/local/bin/ttyd && chmod +x /usr/local/bin/ttyd
48
+
49
+ # ── Ollama ────────────────────────────────────────────────────────────────────
50
+ RUN curl -fsSL https://ollama.com/install.sh | sh
51
+
52
+ # ── nginx cleanup: remove all default configs to avoid conflicts ──────────────
53
+ RUN rm -f /etc/nginx/sites-enabled/default \
54
+ /etc/nginx/sites-available/default \
55
+ /etc/nginx/conf.d/default.conf
56
+
57
+ # ── Workspace ────────────────────────────────────────────────────────────────
58
+ RUN mkdir -p /workspace
59
+
60
+ COPY start.sh /start.sh
61
+ COPY nginx.conf /etc/nginx/sites-enabled/default
62
+ COPY app.py /workspace/app.py
63
+
64
+ RUN chmod +x /start.sh
65
+
66
+ # ── Verify everything is in place at build time ───────────────────────────────
67
+ RUN python3 -c "import fastapi, uvicorn, httpx; print('Python deps OK')"
68
+ RUN python3 -m py_compile /workspace/app.py && echo "app.py syntax OK"
69
+ RUN bash -n /start.sh && echo "start.sh syntax OK"
70
+ RUN nginx -t && echo "nginx config OK"
71
+ RUN which ollama && echo "ollama OK"
72
+ RUN which ttyd && echo "ttyd OK"
73
+
74
+ VOLUME ["/root/.ollama"]
75
+
76
+ EXPOSE 7860
77
+
78
+ CMD ["/start.sh"]