File size: 1,030 Bytes
66b9dc6
 
 
 
 
 
14d4369
 
10a3aa6
 
62122e0
 
66b9dc6
62122e0
 
8681aca
14d4369
62122e0
ae62098
10a3aa6
ae62098
 
62122e0
 
 
 
 
 
14d4369
ae62098
66b9dc6
10a3aa6
62122e0
 
 
 
10a3aa6
14d4369
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
FROM node:20-bookworm-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
    git \
    ca-certificates \
    curl \
    python3 \
    python3-pip \
    && rm -rf /var/lib/apt/lists/*

ARG OPENCODE_VERSION=latest
RUN npm install -g "opencode-ai@${OPENCODE_VERSION}"

COPY requirements.txt /tmp/requirements.txt
RUN pip3 install --no-cache-dir --break-system-packages -r /tmp/requirements.txt

ENV HOME=/home/node
ENV PYTHONUNBUFFERED=1
ENV PATH=/home/node/.local/bin:/usr/local/bin:${PATH}

RUN mkdir -p $HOME/workspace && chown -R node:node $HOME

COPY app.py      $HOME/app.py
COPY shell.html  $HOME/shell.html
COPY sync.py     $HOME/sync.py
COPY start.sh    $HOME/start.sh
RUN chown node:node $HOME/app.py $HOME/shell.html $HOME/sync.py $HOME/start.sh \
    && chmod +x $HOME/start.sh

USER node
WORKDIR $HOME/workspace

EXPOSE 7860

HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
    CMD curl -fsS http://127.0.0.1:7860/__health >/dev/null || exit 1

CMD ["/home/node/start.sh"]