Update Dockerfile
Browse files1234567893 unmodified lines1314151617181920212223242526272829303132FROM node:20-slim# System deps# - tini: PID 1 signal handling# - rsync: optional file migration utilities# - sqlite3: for safe SQLite backup/restoreRUN apt-get update && apt-get install -y --no-install-recommends \ca-certificates \git \3 unmodified linessqlite3 \&& rm -rf /var/lib/apt/lists/*# IMPORTANT: Create mountpoint(s) early + make writable for UID 1000 runtime# HF Docker Spaces docs mention UID 1000 runtime; /data is commonly used for persistence.<!--citation:1-->RUN mkdir -p /data && chmod 777 /data# Install OpenCodeRUN npm install -g opencode-ai# Provide a no-op xdg-open shim to avoid noisy "Executable not found" logs# (opencode web tries to open a browser; in headless containers it's meaningless)RUN printf '#!/bin/sh\nexit 0\n' > /usr/local/bin/xdg-open && chmod +x /usr/local/bin/xdg-openWORKDIR /home/nodeCOPY --chown=node:node start.sh /home/node/start.shCOPY --chown=node:node opencode.json.example /home/node/opencode.json.exampleRUN chmod +x /home/node/start.shUSER node123453 unmodified lines910111213141516171819202122232425262728FROM node:20-slimRUN apt-get update && apt-get install -y --no-install-recommends \ca-certificates \git \3 unmodified linessqlite3 \&& rm -rf /var/lib/apt/lists/*RUN mkdir -p /data && chmod 777 /dataRUN npm install -g opencode-aiRUN printf '#!/bin/sh\nexit 0\n' > /usr/local/bin/xdg-open && chmod +x /usr/local/bin/xdg-openWORKDIR /home/nodeCOPY --chown=node:node start.sh /home/node/start.shCOPY --chown=node:node opencode.json.example /home/node/opencode.json.example# --- CRLF -> LF (重要:修复 /usr/bin/env: bash\r) ---RUN sed -i 's/\r$//' /home/node/start.shRUN chmod +x /home/node/start.shUSER node
Dockerfile+5-9