-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
57 lines (47 loc) · 1.75 KB
/
Dockerfile
File metadata and controls
57 lines (47 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
FROM node:22-bookworm-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
bash \
ca-certificates \
chromium \
curl \
git \
gosu \
less \
procps \
ripgrep \
xauth \
xvfb \
unzip \
xz-utils \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -ms /bin/bash termlings
ENV HOME=/home/termlings
ENV TERM=xterm-256color
ENV COLORTERM=truecolor
ENV BUN_INSTALL=/opt/bun
ENV NPM_CONFIG_PREFIX=/home/termlings/.npm-global
ENV AGENT_BROWSER_EXECUTABLE_PATH=/usr/bin/chromium
ENV PATH=/home/termlings/.local/bin:/home/termlings/.npm-global/bin:/opt/bun/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUN curl -fsSL https://bun.sh/install | env BUN_INSTALL=/opt/bun bash \
&& ln -sf /opt/bun/bin/bun /usr/local/bin/bun \
&& ln -sf /opt/bun/bin/bunx /usr/local/bin/bunx
WORKDIR /opt/termlings
COPY --chown=termlings:termlings package.json bun.lock /opt/termlings/
RUN chown -R termlings:termlings /opt/termlings
USER termlings
RUN mkdir -p /home/termlings/.npm-global /home/termlings/.local/bin
RUN npm install -g @openai/codex agent-browser
RUN curl -fsSL https://claude.ai/install.sh | bash
RUN bun install --frozen-lockfile
USER root
COPY --chown=termlings:termlings bin /opt/termlings/bin
COPY --chown=termlings:termlings src /opt/termlings/src
COPY --chown=termlings:termlings templates /opt/termlings/templates
COPY --chown=termlings:termlings scripts /opt/termlings/scripts
RUN printf '%s\n' '#!/bin/sh' 'exec bun /opt/termlings/bin/termlings.js "$@"' > /usr/local/bin/termlings \
&& chmod +x /usr/local/bin/termlings
RUN chmod +x /opt/termlings/scripts/docker-entrypoint.sh /opt/termlings/scripts/docker-shell
WORKDIR /workspaces
ENTRYPOINT ["/opt/termlings/scripts/docker-entrypoint.sh"]
CMD ["sleep", "infinity"]