-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile
70 lines (61 loc) · 2.3 KB
/
Dockerfile
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
60
61
62
63
64
65
66
67
68
69
70
FROM cgr.dev/chainguard/wolfi-base AS base
RUN apk add --no-cache go make git npm pnpm
FROM base AS bin
WORKDIR /app
COPY . .
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store \
--mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/.cache/uv \
--mount=type=cache,target=/root/go/pkg/mod \
make all
FROM base AS tools
RUN apk add --no-cache curl python-3.13 py3.13-pip
WORKDIR /app
COPY . .
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store \
--mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/.cache/uv \
--mount=type=cache,target=/root/go/pkg/mod \
UV_LINK_MODE=copy BIN_DIR=/bin make package-tools
FROM cgr.dev/chainguard/postgres:latest-dev AS build-pgvector
RUN apk add build-base git postgresql-dev
RUN git clone --branch v0.8.0 https://github.com/pgvector/pgvector.git && \
cd pgvector && \
make clean && \
make OPTFLAGS="" && \
make install && \
cd .. && \
rm -rf pgvector
FROM cgr.dev/chainguard/postgres:latest-dev AS final
ENV POSTGRES_USER=obot
ENV POSTGRES_PASSWORD=obot
ENV POSTGRES_DB=obot
ENV PGDATA=/data/postgresql
COPY --from=build-pgvector /usr/lib/postgresql17/vector.so /usr/lib/postgresql17/
COPY --from=build-pgvector /usr/share/postgresql17/extension/vector* /usr/share/postgresql17/extension/
RUN apk add --no-cache git python-3.13 py3.13-pip openssh-server npm bash tini procps libreoffice
COPY --chmod=0755 /tools/package-chrome.sh /
RUN /package-chrome.sh && rm /package-chrome.sh
RUN sed -E 's/^#(PermitRootLogin)no/\1yes/' /etc/ssh/sshd_config -i
RUN ssh-keygen -A
RUN mkdir /run/sshd && /usr/sbin/sshd
COPY encryption.yaml /
COPY --chmod=0755 run.sh /bin/run.sh
COPY --link --from=tools /app/obot-tools /obot-tools
COPY --from=bin /app/bin/obot /bin/
EXPOSE 22
# libreoffice executables
ENV PATH=/obot-tools/venv/bin:$PATH:/usr/lib/libreoffice/program
ENV HOME=/data
ENV XDG_CACHE_HOME=/data/cache
ENV GPTSCRIPT_SYSTEM_TOOLS_DIR=/obot-tools/
ENV OBOT_SERVER_WORKSPACE_TOOL=/obot-tools/workspace-provider
ENV OBOT_SERVER_DATASETS_TOOL=/obot-tools/datasets
ENV OBOT_SERVER_TOOL_REGISTRY=/obot-tools
ENV OBOT_SERVER_ENCRYPTION_CONFIG_FILE=/encryption.yaml
ENV GOMEMLIMIT=1GiB
ENV BAAAH_THREADINESS=20
ENV TERM=vt100
WORKDIR /data
VOLUME /data
ENTRYPOINT ["run.sh"]