vps1122 / Dockerfile
proti0070's picture
Update Dockerfile
ad46b6a verified
FROM kalilinux/kali-rolling
ENV DEBIAN_FRONTEND=noninteractive
ENV HOSTNAME=xro
# ── System packages ───────────────────────────────────────────────────────────
RUN apt-get update && apt-get install -y \
ca-certificates \
curl \
wget \
git \
sudo \
htop \
btop \
neovim \
nano \
tmux \
screen \
lsof \
net-tools \
nmap \
netcat-traditional \
whois \
dnsutils \
python3 \
python3-pip \
python3-full \
libssl-dev \
libffi-dev \
nodejs \
npm \
nginx \
dbus \
&& rm -rf /var/lib/apt/lists/*
# ── Node v22 ─────────────────────────────────────────────────────────────────
RUN npm install -g n && n 22 && hash -r
# ── Python deps (FastAPI server) ──────────────────────────────────────────────
RUN pip3 install --break-system-packages \
fastapi \
"uvicorn[standard]" \
httpx
# ── ttyd ─────────────────────────────────────────────────────────────────────
RUN curl -fsSL https://github.com/tsl0922/ttyd/releases/download/1.7.4/ttyd.x86_64 \
-o /usr/local/bin/ttyd && chmod +x /usr/local/bin/ttyd
# ── Ollama ────────────────────────────────────────────────────────────────────
RUN curl -fsSL https://ollama.com/install.sh | sh
# ── nginx cleanup: remove all default configs to avoid conflicts ──────────────
RUN rm -f /etc/nginx/sites-enabled/default \
/etc/nginx/sites-available/default \
/etc/nginx/conf.d/default.conf
# ── Workspace ────────────────────────────────────────────────────────────────
RUN mkdir -p /workspace
COPY start.sh /start.sh
COPY nginx.conf /etc/nginx/sites-enabled/default
COPY app.py /workspace/app.py
RUN chmod +x /start.sh
# ── Verify everything is in place at build time ───────────────────────────────
RUN python3 -c "import fastapi, uvicorn, httpx; print('Python deps OK')"
RUN python3 -m py_compile /workspace/app.py && echo "app.py syntax OK"
RUN bash -n /start.sh && echo "start.sh syntax OK"
RUN nginx -t && echo "nginx config OK"
RUN which ollama && echo "ollama OK"
RUN which ttyd && echo "ttyd OK"
VOLUME ["/root/.ollama"]
EXPOSE 7860
CMD ["/start.sh"]