Open-Claude / Dockerfile
OrbitMC's picture
Create Dockerfile
33b5e73 verified
# Use Node 22 for OpenClaude compatibility
FROM node:22-bookworm
# 1. Install system tools (ripgrep is required by OpenClaude)
RUN apt-get update && apt-get install -y \
ripgrep build-essential cmake git libjson-c-dev libwebsockets-dev \
&& rm -rf /var/lib/apt/lists/*
# 2. Install ttyd (Web Terminal)
RUN git clone --depth=1 https://github.com/tsl0922/ttyd.git && \
cd ttyd && mkdir build && cd build && \
cmake .. && make && make install && \
cd ../.. && rm -rf ttyd
# 3. Create a non-root user (Required for HF Spaces)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# 4. Install OpenClaude globally for the user
RUN npm install -g @gitlawb/openclaude
# 5. Set up the persistent directory
# We assume the Bucket is mounted at /data
WORKDIR /data
# Expose the HF default port
EXPOSE 7860
# Start ttyd.
# -W allows writing (typing in the terminal)
# -p 7860 is the port HF listens to
# /bin/bash is the starting shell
CMD ["ttyd", "-W", "-p", "7860", "/bin/bash"]