Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (45 loc) · 2.19 KB
/
Copy pathDockerfile
File metadata and controls
59 lines (45 loc) · 2.19 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
58
59
FROM ubuntu
ARG TEA_VERSION=0.15.1
RUN apt update && apt install -y wget curl xdg-utils docker.io sudo \
&& mkdir -p -m 755 /etc/apt/keyrings \
&& out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
&& cat $out | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
&& chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& mkdir -p -m 755 /etc/apt/sources.list.d \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& apt update \
&& apt install gh -y \
&& rm -rf /var/lib/apt/lists/*
RUN curl -fsSL "https://dl.gitea.com/tea/${TEA_VERSION}/tea-${TEA_VERSION}-linux-$(dpkg --print-architecture)" -o /usr/local/bin/tea \
&& chmod +x /usr/local/bin/tea \
&& tea --version
ENV HOME=/home/ubuntu \
PATH="/home/ubuntu/.opencode/bin:$PATH" \
BROWSER=true \
OPENCODE_ENABLE_EXA=1
RUN curl -fsSL https://opencode.ai/install | bash \
&& mkdir -p /home/ubuntu/.config/opencode \
&& chown -R ubuntu:ubuntu /home/ubuntu
COPY init.sh /home/ubuntu/init.sh
RUN chmod +x /home/ubuntu/init.sh
RUN echo "ubuntu ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/ubuntu \
&& chmod 0440 /etc/sudoers.d/ubuntu
USER ubuntu
COPY GLOBAL_AGENTS.md /home/ubuntu/.config/opencode/AGENTS.md
COPY opencode.jsonc /home/ubuntu/.config/opencode/opencode.jsonc
RUN mkdir -p /home/ubuntu/workspace /home/ubuntu/my-opencode-setup
WORKDIR /home/ubuntu/workspace
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
CMD if [ -n "$OPENCODE_SERVER_PASSWORD" ]; then \
curl -fsS -u "opencode:$OPENCODE_SERVER_PASSWORD" http://localhost:3000/global/health > /dev/null; \
else \
curl -fsS http://localhost:3000/global/health > /dev/null; \
fi || exit 1
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
CMD if [ -n "$OPENCODE_SERVER_PASSWORD" ]; then \
curl -fsS -u "opencode:$OPENCODE_SERVER_PASSWORD" http://localhost:3000/global/health > /dev/null; \
else \
curl -fsS http://localhost:3000/global/health > /dev/null; \
fi || exit 1
CMD ["/home/ubuntu/init.sh"]