Download Dockerfile from immahadi/OpenCode: direct link, hf CLI and curl.
- Browser
- Download file 1.6 kB
-
https://huggingface.co/spaces/immahadi/OpenCode/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/immahadi/OpenCode/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/immahadi/OpenCode/resolve/main/Dockerfile
1.6 kB
| # Use Node.js 22 slim image (includes Node.js and npm pre-installed) | |
| FROM node:22-slim | |
| # Prevent interactive prompts during package installation | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| # Install Python3, pip, venv, Git, curl, wget, build tools, sudo, and useful CLI utilities | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| python3 \ | |
| python3-pip \ | |
| python3-venv \ | |
| python3-dev \ | |
| git \ | |
| curl \ | |
| wget \ | |
| bash \ | |
| ca-certificates \ | |
| build-essential \ | |
| sudo \ | |
| jq \ | |
| ripgrep \ | |
| unzip \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Create symlink so 'python' command points to 'python3' | |
| RUN ln -sf /usr/bin/python3 /usr/bin/python | |
| # Install @opencode/cli globally | |
| RUN npm install -g @opencode/cli | |
| # Heroku CLI | |
| RUN npm install -g heroku | |
| # Point HOME, XDG, npm cache, and pip directories to /data for full persistence | |
| ENV HOME=/data \ | |
| XDG_CONFIG_HOME=/data/.config \ | |
| XDG_DATA_HOME=/data/.local/share \ | |
| XDG_STATE_HOME=/data/.local/state \ | |
| XDG_CACHE_HOME=/data/.cache \ | |
| NPM_CONFIG_CACHE=/data/.npm \ | |
| PIP_CACHE_DIR=/data/.cache/pip \ | |
| PIP_BREAK_SYSTEM_PACKAGES=1 \ | |
| PATH="/data/.local/bin:${PATH}" | |
| # Set default working directory inside /data/workspace | |
| WORKDIR /data/workspace | |
| # Hugging Face default port | |
| EXPOSE 7860 | |
| # Fix ownership of /data at startup and start OpenCode server | |
| CMD ["sh", "-c", "rm -rf /data/.cache/opencode/bin/opencode-pty && mkdir -p /data/workspace /data/.config/opencode /data/.local/share /data/.local/state /data/.cache /data/.npm /data/.local/bin && opencode serve --hostname 0.0.0.0 --port 7860"] | |