ollama / Dockerfile
atikur-rabbi's picture
dsh v3
803c315
Raw History Blame Contribute Delete
1.23 kB
FROM node:24-bookworm-slim
# Install basic utilities and build tools
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
git \
gnupg \
python3 \
&& rm -rf /var/lib/apt/lists/*
# Enable corepack (pnpm) and install DeepSeek Harness CLI globally
RUN corepack enable && npm install -g @deepseek-ai/dsh@latest
# Set up persistent data and workspace directories
ENV DSH_HOME=/data/dsh
RUN mkdir -p /data/dsh /workspace
# Create entrypoint script to start DSH
RUN cat <<'EOF' > /entrypoint.sh
#!/usr/bin/env bash
set -euo pipefail
cd /workspace
bind_host="$(hostname -i | awk '{print $1}')"
if [ -z "$bind_host" ]; then
echo "Could not determine the container IP address" >&2
exit 1
fi
args=(web --host "$bind_host" --port 7860 --no-open)
space_hosts="${HF_SPACE_HOST:-${SPACE_HOST:-}}"
if [ -n "$space_hosts" ]; then
IFS=',' read -r -a hosts <<< "$space_hosts"
args+=(--public-url "https://${hosts[0]}/")
for host in "${hosts[@]}"; do
args+=(--trusted-host "$host")
done
fi
exec dsh "${args[@]}"
EOF
RUN chmod +x /entrypoint.sh
VOLUME ["/data/dsh", "/workspace"]
EXPOSE 7860
ENTRYPOINT ["/entrypoint.sh"]