Update Dockerfile
Browse files- Dockerfile +73 -11
Dockerfile
CHANGED
|
@@ -1,16 +1,78 @@
|
|
| 1 |
-
|
| 2 |
-
# you will also find guides on how best to write your Dockerfile
|
| 3 |
|
| 4 |
-
|
|
|
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
-
|
|
|
|
| 11 |
|
| 12 |
-
|
| 13 |
-
RUN
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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"]
|