-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.opencode
More file actions
21 lines (16 loc) · 900 Bytes
/
Copy pathDockerfile.opencode
File metadata and controls
21 lines (16 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# opencode server image: runs `opencode serve` for all projects mounted under /projects
FROM node:24-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends git curl ca-certificates ripgrep \
&& rm -rf /var/lib/apt/lists/*
RUN npm install -g opencode-ai --no-audit --no-fund
# non-root; state (auth, sessions, logs) lives under /home/node/.local and
# /home/node/.config. Pre-create those paths owned by node: a fresh named
# volume copies the image's ownership, otherwise it is created root-owned
# and opencode dies at startup with EACCES on mkdir.
RUN mkdir -p /projects /home/node/.local/share/opencode /home/node/.local/state/opencode /home/node/.config/opencode && chown -R node:node /projects /home/node
USER node
WORKDIR /projects
ENV OPENCODE_SERVER_USERNAME=opencode
EXPOSE 4096
CMD ["opencode", "serve", "--hostname", "0.0.0.0", "--port", "4096"]