maestro/Dockerfile
clade 7049a874f3 feat: initial public release (MAESTRO v0.1.0)
Open-source release of MAESTRO, an agent orchestration platform that runs
LLM-driven tasks through sandboxed tools, with a web UI. Apache-2.0.
See README.md and docs/ (getting-started, configuration, architecture).
2026-06-03 04:01:14 +00:00

73 lines
2.1 KiB
Docker

FROM node:22-alpine AS builder
WORKDIR /app
# 依存関係のインストール
COPY package.json package-lock.json* ./
COPY ui/package.json ui/package-lock.json* ./ui/
RUN npm ci --ignore-scripts
RUN npm --prefix ui ci --ignore-scripts
# noVNC スタンドアロン (vnc.html を含む Web 配布物) を取得。
# npm の @novnc/novnc は lib のみで vnc.html を含まないため、
# Browser タブの iframe 用に GitHub から tarball を取得する。
ARG NOVNC_VERSION=1.6.0
RUN apk add --no-cache --virtual .novnc-fetch curl tar \
&& mkdir -p /app/vendor/noVNC \
&& curl -fSL "https://github.com/novnc/noVNC/archive/refs/tags/v${NOVNC_VERSION}.tar.gz" \
| tar -xz -C /app/vendor/noVNC --strip-components=1 \
&& test -f /app/vendor/noVNC/vnc.html \
&& apk del .novnc-fetch
# TypeScript ビルド
COPY tsconfig.json ./
COPY src ./src
COPY ui ./ui
RUN npm run build:server
RUN npm run build:ui
# --- ランタイムステージ ---
FROM node:22-alpine AS runtime
RUN apk add --no-cache \
git \
ca-certificates \
tzdata \
bash \
bubblewrap \
python3 \
py3-pip
# Pre-bake python packages into the system site-packages (read-only bind-mounted
# into every bash sandbox). Runtime `pip install` is intentionally unsupported.
COPY runtime/python-requirements.txt /tmp/python-requirements.txt
RUN pip3 install --no-cache-dir --break-system-packages -r /tmp/python-requirements.txt \
&& rm /tmp/python-requirements.txt
WORKDIR /app
# 本番依存のみインストール
COPY package.json package-lock.json* ./
RUN npm ci --omit=dev --ignore-scripts
# ビルド済み成果物をコピー
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/ui/dist ./ui/dist
COPY --from=builder /app/vendor ./vendor
# schema.sql は dist に含まれないため個別コピー
COPY src/db/schema.sql ./dist/db/schema.sql
# デフォルト設定
COPY config.yaml ./
# データ永続化ディレクトリ
RUN mkdir -p /data /workspaces
ENV NODE_ENV=production \
PORT=9876 \
DB_PATH=/data/maestro.db
EXPOSE 9876
CMD ["node", "dist/index.js"]