Download Dockerfile from kacapower/opencode: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/spaces/kacapower/opencode/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/kacapower/opencode/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/kacapower/opencode/resolve/main/Dockerfile
1.03 kB
| FROM node:20-bookworm-slim | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| git \ | |
| ca-certificates \ | |
| curl \ | |
| python3 \ | |
| python3-pip \ | |
| && rm -rf /var/lib/apt/lists/* | |
| ARG OPENCODE_VERSION=latest | |
| RUN npm install -g "opencode-ai@${OPENCODE_VERSION}" | |
| COPY requirements.txt /tmp/requirements.txt | |
| RUN pip3 install --no-cache-dir --break-system-packages -r /tmp/requirements.txt | |
| ENV HOME=/home/node | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV PATH=/home/node/.local/bin:/usr/local/bin:${PATH} | |
| RUN mkdir -p $HOME/workspace && chown -R node:node $HOME | |
| COPY app.py $HOME/app.py | |
| COPY shell.html $HOME/shell.html | |
| COPY sync.py $HOME/sync.py | |
| COPY start.sh $HOME/start.sh | |
| RUN chown node:node $HOME/app.py $HOME/shell.html $HOME/sync.py $HOME/start.sh \ | |
| && chmod +x $HOME/start.sh | |
| USER node | |
| WORKDIR $HOME/workspace | |
| EXPOSE 7860 | |
| HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \ | |
| CMD curl -fsS http://127.0.0.1:7860/__health >/dev/null || exit 1 | |
| CMD ["/home/node/start.sh"] | |