Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 13 additions & 15 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ ARG OLLAMA_VERSION=0.32.5
# Use the official Ollama image to get the binary
FROM ollama/ollama:${OLLAMA_VERSION} AS ollama-bin

# ── Tailscale binaries from official image ─────────────────────────────
FROM tailscale/tailscale:stable AS tailscale

# ── Node.js builder: ModelRelay + OmniRoute + Hermes Web UI + TUI ───────
FROM node:24-slim AS node-builder

Expand Down Expand Up @@ -112,13 +115,20 @@ ENV DEBIAN_FRONTEND=noninteractive
# Copy the Ollama binary from the official image
COPY --from=ollama-bin --chown=1000:1000 /usr/bin/ollama /usr/local/bin/ollama

# Copy Tailscale binaries from the official image
COPY --from=tailscale /usr/local/bin/tailscaled /usr/local/bin/tailscaled
COPY --from=tailscale /usr/local/bin/tailscale /usr/local/bin/tailscale

# Create Tailscale state directories
RUN mkdir -p /var/run/tailscale /var/lib/tailscale /var/cache/tailscale

# ── System packages + ALL heavy installs in ONE layer ──────────────────.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
zsh ripgrep jq curl git ca-certificates gnupg zstd sudo \
python3 python3-pip nodejs npm \
&& rm -rf /var/lib/apt/lists/* \

\
# ── Ensure a non-root user with UID 1000 exists ──────────────────────
&& UID1000_USER=$(getent passwd 1000 | cut -d: -f1) \
&& if [ -z "$UID1000_USER" ]; then \
Expand All @@ -128,10 +138,10 @@ RUN apt-get update \
fi \
&& echo "${UID1000_USER} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/vscode \
&& chmod 0440 /etc/sudoers.d/vscode \

\
# ── Ollama (direct binary install – reliable in Docker) ───────────
&& ollama --version \

\
# ── Bake Ollama embedding model into image ───────────────────────
# Pull nomic-embed-text at build time so it's available instantly
# at runtime with zero RAM spike or download delay. (~300MB)
Expand All @@ -144,15 +154,7 @@ RUN apt-get update \
OLLAMA_MODELS=/usr/share/ollama/.ollama/models /usr/local/bin/ollama pull nomic-embed-text && \
ls -la /usr/share/ollama/.ollama/models/ && \
find /usr/share/ollama/.ollama/models -type f | head -20 && \
OLLAMA_MODELS=/usr/share/ollama/.ollama/models ollama list && \
kill %1 && wait 2>/dev/null || true \
\
# ── TailScale ─────────────────────────────────────────────────────
#&& mkdir -p /var/run/tailscale /var/lib/tailscale \
#&& (curl -fsSL https://tailscale.com/install.sh | bash || echo "WARN: tailscale install failed, continuing") \
#&& rm -rf /var/lib/apt/lists/* \


# ── Mnemon ────────────────────────────────────────────────────────
&& ARCH=amd64 \
&& curl -sL "https://github.com/mnemon-dev/mnemon/releases/download/v${MNEMON_VERSION}/mnemon_${MNEMON_VERSION}_linux_${ARCH}.tar.gz" \
Expand All @@ -161,11 +163,7 @@ RUN apt-get update \
&& cp /tmp/mnemon /usr/local/bin/mnemon \
&& chmod +x /usr/local/bin/mnemon \
&& rm -rf /tmp/mnemon.tar.gz /tmp/mnemon \


&& curl -fsSL https://claude.ai/install.sh | bash \


# ── Final cleanup ─────────────────────────────────────────────────
&& apt-get autoremove -y \
&& apt-get clean \
Expand Down
Loading