# 1. Node.js stable version FROM node:18-slim # 2. Install required system tools & HF CLI RUN apt-get update && apt-get install -y \ curl \ bash \ git \ python3 \ python3-pip \ python3.11-venv \ build-essential \ gcc \ g++ \ make \ nano \ zip \ unzip \ procps \ inotify-tools \ && curl -LsSf https://hf.co/cli/install.sh | bash \ && rm -rf /var/lib/apt/lists/* # 3. Install OpenCode RUN curl -fsSL https://opencode.ai/install | bash # 4. Setup folders RUN mkdir -p /home && chmod 777 /home # 5. Copy entrypoint script COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh # 6. Environment settings with RAM limit ENV OPENCODE_DATA_DIR=/home ENV HOME=/home ENV PATH="/root/.local/bin:/home/node/.local/bin:/home/.local/bin:$PATH" ENV NODE_OPTIONS="--max-old-space-size=14336" # 7. Expose port 7860 EXPOSE 7860 # 8. Run entrypoint script CMD ["/entrypoint.sh"]