forked from Yeachan-Heo/gajae-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.robogjc
More file actions
75 lines (64 loc) · 3.08 KB
/
Copy pathDockerfile.robogjc
File metadata and controls
75 lines (64 loc) · 3.08 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# syntax=docker/dockerfile:1.7-labs
###############################################################################
# robogjc — GitHub triage+fix bot orchestrator.
#
# Extends `pi-base` (from /Dockerfile, default target gajae-code/pi:dev) and adds
# the robogjc Python package + a Vite-built SolidJS dashboard bundle. The pi
# toolchain (python + bun + rustup launcher + pi-natives + gjc_rpc wheel +
# /usr/local/bin/gjc shim) all comes from PI_BASE; this file only layers what's
# robogjc-specific.
#
# Build (from pi root):
# bun run pi:image # build gajae-code/pi:dev first
# docker build -f Dockerfile.robogjc -t robogjc:dev .
#
# Compose (recommended):
# docker compose --project-directory python/robogjc build
###############################################################################
ARG PI_BASE=gajae-code/pi:dev
ARG BUN_VERSION=1.3.14
############################
# 1) web-builder — Bun + Vite, builds the SolidJS dashboard bundle.
############################
FROM oven/bun:${BUN_VERSION}-slim AS web-builder
WORKDIR /work
# Root manifests + the web workspace manifest are enough for `bun install
# --filter robogjc-web` to hydrate just the dashboard's node_modules.
COPY package.json bun.lock ./
COPY python/robogjc/web/package.json ./python/robogjc/web/package.json
RUN bun install --filter robogjc-web
COPY --exclude=node_modules --exclude=dist python/robogjc/web/ ./python/robogjc/web/
RUN bun --cwd=python/robogjc/web run build
############################
# 2) runtime — pi-base + robogjc src + web bundle + pip install
############################
FROM ${PI_BASE} AS runtime
# robogjc runs against the host pi checkout mounted at /work/pi read-only.
ENV PI_ROOT=/work/pi
WORKDIR /app
# robogjc itself. Drop the Vite-built dashboard into the package tree before
# `pip install` so it lands in the installed wheel (`static/**/*` is declared
# as package-data in pyproject.toml).
COPY python/robogjc/pyproject.toml ./
COPY python/robogjc/src/ ./src/
COPY --from=web-builder /work/python/robogjc/web/dist/ ./src/static/
RUN pip install --no-cache-dir \
"fastapi>=0.112" "uvicorn[standard]>=0.30" "httpx>=0.27" \
"pydantic>=2.6" "pydantic-settings>=2.2" "python-dotenv>=1.0" \
"click>=8.1" \
&& pip install --no-cache-dir --no-deps .
# Host agent config is mounted read-only under /srv/agent-home-stage with
# host-controlled permissions. The entrypoint copies it into root-owned
# world-readable files under /srv/agent-home; the agent subprocess runs with
# HOME=/srv/agent-home, so ~/.gjc and ~/.agent resolve there without exposing
# mutable host mounts.
RUN mkdir -p /srv/agent-home/.agent /srv/agent-home/.gjc/agent \
&& mkdir -p /srv/agent-home-stage/.agent /srv/agent-home-stage/.gjc/agent \
&& printf '[install]\nbackend = "copyfile"\n' > /srv/agent-home/.bunfig.toml
COPY python/robogjc/entrypoint.sh /usr/local/bin/robogjc-entrypoint
RUN chmod +x /usr/local/bin/robogjc-entrypoint
VOLUME ["/data"]
EXPOSE 8080
EXPOSE 8081
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/robogjc-entrypoint"]
CMD ["python", "-m", "robogjc", "serve"]