-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.aio
More file actions
97 lines (77 loc) · 3.31 KB
/
Dockerfile.aio
File metadata and controls
97 lines (77 loc) · 3.31 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# ── Stage 1: Build the Node app (reuses existing Dockerfile logic) ────
FROM node:20-slim AS app-builder
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci
COPY tsconfig.json vite.config.ts ./
COPY src/ src/
COPY lib/ lib/
COPY web/ web/
COPY mcp-config.json ./
# Build: type-check + Vite SPA
RUN npx tsc --noEmit && npx vite build --config vite.config.ts
# Prune to production deps + tsx for TS runtime
RUN npm prune --omit=dev 2>/dev/null; npm install tsx
# ── Stage 2: Download Gitea binary ────────────────────────────────────
FROM debian:bookworm-slim AS gitea-downloader
ARG GITEA_VERSION=1.24.0
RUN apt-get update && apt-get install -y --no-install-recommends wget ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN ARCH=$(dpkg --print-architecture) \
&& wget -qO /usr/local/bin/gitea \
"https://dl.gitea.com/gitea/${GITEA_VERSION}/gitea-${GITEA_VERSION}-linux-${ARCH}" \
&& chmod +x /usr/local/bin/gitea
# ── Stage 3: Final AIO image ─────────────────────────────────────────
FROM debian:bookworm-slim
# System packages: Node.js, Chrome, display, VNC, supervisor, nginx, tools
RUN apt-get update && apt-get install -y --no-install-recommends \
# Node.js runtime
curl ca-certificates \
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \
# Chrome + display
chromium xvfb x11vnc novnc websockify \
# Networking & tools
nginx supervisor git ssh postgresql-client jq \
# Chrome dependencies
libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 \
libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 \
libasound2 libatspi2.0-0 libgtk-3-0 \
# Docker CLI (for runner-worker image build)
docker.io \
&& rm -rf /var/lib/apt/lists/* \
&& rm -f /etc/nginx/sites-enabled/default \
&& ln -sf /usr/share/novnc/vnc.html /usr/share/novnc/index.html
# Install Claude Code CLI
RUN curl -fsSL https://claude.ai/install.sh | bash \
|| npm install -g @anthropic-ai/claude-code
# Create gigi user
RUN useradd -m -s /bin/bash gigi \
&& mkdir -p /data/gitea /data/workspace /data/chrome-profile /var/log/gigi /opt/runner-worker \
&& chown -R gigi:gigi /data /var/log/gigi
# Gitea binary
COPY --from=gitea-downloader /usr/local/bin/gitea /usr/local/bin/gitea
# Node app
WORKDIR /app
COPY --from=app-builder /app/node_modules ./node_modules
COPY --from=app-builder /app/dist ./dist
COPY --from=app-builder /app/package.json ./
COPY src/ src/
COPY lib/ lib/
COPY web/ web/
COPY mcp-config.json ./
COPY gigi.config.yaml ./
COPY gitea/ gitea/
COPY scripts/entrypoint.sh scripts/
# AIO config
COPY aio/supervisord.conf /etc/supervisor/conf.d/gigi-aio.conf.template
COPY aio/cdp-proxy.conf /etc/nginx/conf.d/cdp-proxy.conf
COPY aio/entrypoint.sh /aio-entrypoint.sh
RUN chmod +x /aio-entrypoint.sh
# Runner-worker Dockerfile (for bootstrap build)
COPY runner-worker/Dockerfile /opt/runner-worker/Dockerfile
RUN chown -R gigi:gigi /app
EXPOSE 2222 3000 6080
HEALTHCHECK --interval=15s --timeout=5s --start-period=120s --retries=3 \
CMD curl -f http://localhost:3000/health || exit 1
CMD ["/aio-entrypoint.sh"]