Spaces:
Paused
Paused
Create Dockerfile
Browse files12345678910111213141516171819202122232425262728293031323334# Hugging Face Spaces (Docker) runs a web server on port 7860 by default.# This image installs OpenCode (opencode) and runs the web UI.
FROM node:20-slim
# Basic deps + tini for clean signal handlingRUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ git \ curl \ tini \ && rm -rf /var/lib/apt/lists/*
# Install OpenCode (provides the `opencode` CLI)RUN npm install -g opencode-ai
# Create a non-root user (HF Spaces commonly expects UID 1000)RUN useradd -m -u 1000 userUSER user
ENV HOME=/home/userWORKDIR /home/user/app
# Optional: copy your Space repo contents into the imageCOPY --chown=user:user . .
# OpenCode web server port for HF SpacesEXPOSE 7860
# IMPORTANT:# - Set OPENCODE_SERVER_PASSWORD as a HF Space Secret (recommended for public Spaces).# - Optionally set OPENCODE_SERVER_USERNAME too.ENTRYPOINT ["/usr/bin/tini","--"]CMD ["opencode","web","--hostname","0.0.0.0","--port","7860"]DockerfileAdded+34