FROM python:3.9-slim ENV DEBIAN_FRONTEND=noninteractive \ HOME=/root \ PATH=/root/.opencode/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/sbin:/bin \ PORT=7860 # Runtime deps: curl/unzip for the installer, git + ripgrep for the agent. RUN apt-get update && apt-get install -y --no-install-recommends \ curl ca-certificates git unzip bash jq ripgrep \ && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY requirements.txt /app/requirements.txt RUN pip install --no-cache-dir -r /app/requirements.txt # Install the prebuilt opencode binary (linux-x64 / linux-arm64). RUN curl -fsSL https://opencode.ai/install | bash COPY app.py /app/app.py RUN chmod -R 777 /app # Workspace used as the agent's project directory. RUN mkdir -p /app/workspace && chmod -R 777 /app/workspace WORKDIR /app/workspace EXPOSE 7860 CMD ["python", "/app/app.py"]