From daba42cf97571a9c3480be7adbc18e0ab46058e9 Mon Sep 17 00:00:00 2001 From: Regina Fischer Date: Sun, 19 Jul 2026 16:43:28 +0530 Subject: [PATCH 1/2] feat(ci): Setup docker builds for GUI --- .dockerignore | 21 ++++++++++++ .github/workflows/build-image.yml | 53 +++++++++++++++++++++++++++++ apps/gui/Dockerfile | 55 +++++++++++++++++++++++++++++++ docker-compose.yml | 15 +++++++++ 4 files changed, 144 insertions(+) create mode 100644 .dockerignore create mode 100644 .github/workflows/build-image.yml create mode 100644 apps/gui/Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..0836d72 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,21 @@ +node_modules/ +.git/ +.gitignore +.gitattributes +*.md +.editorconfig +.prettierrc +.prettierignore +eslint.config.mjs +.env +.env* +tests/ +content/ +docs/ +web/landing/ +web/docs/ +vitest.config.ts +*.tsbuildinfo +.next/ +dist/ +.astro/ diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml new file mode 100644 index 0000000..3df51f9 --- /dev/null +++ b/.github/workflows/build-image.yml @@ -0,0 +1,53 @@ +name: Build Docker Image + +on: + push: + branches: [master] + tags: ["v*"] + pull_request: + branches: [master] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository }}/omnia-gui + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=sha,format=short + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: . + file: apps/gui/Dockerfile + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + provenance: false diff --git a/apps/gui/Dockerfile b/apps/gui/Dockerfile new file mode 100644 index 0000000..3d9abf6 --- /dev/null +++ b/apps/gui/Dockerfile @@ -0,0 +1,55 @@ +FROM node:22-slim AS base +ENV PNPM_HOME="/pnpm" \ + PATH="$PNPM_HOME:$PATH" +RUN corepack enable && corepack prepare pnpm@11.13.0 --activate +WORKDIR /app + +FROM base AS build-deps +RUN apt-get update -qq && \ + apt-get install -qq -y --no-install-recommends \ + python3 make g++ && \ + rm -rf /var/lib/apt/lists/* + +COPY pnpm-lock.yaml pnpm-workspace.yaml ./ +COPY package.json tsconfig.json tsconfig.base.json ./ +COPY apps/gui/package.json apps/gui/package.json +COPY apps/gui/tsconfig.json apps/gui/tsconfig.json +COPY apps/gui/next.config.ts apps/gui/next.config.ts +COPY apps/gui/postcss.config.mjs apps/gui/postcss.config.mjs +COPY apps/gui/components.json apps/gui/components.json +COPY packages/actor/package.json packages/actor/package.json +COPY packages/architect/package.json packages/architect/package.json +COPY packages/core/package.json packages/core/package.json +COPY packages/intent/package.json packages/intent/package.json +COPY packages/llm/package.json packages/llm/package.json +COPY packages/memory/package.json packages/memory/package.json +COPY packages/scenario/package.json packages/scenario/package.json +COPY packages/spatial/package.json packages/spatial/package.json +RUN --mount=type=cache,id=pnpm,target=/pnpm/store \ + pnpm install --frozen-lockfile + +FROM build-deps AS builder +COPY . . +RUN pnpm build +RUN pnpm --filter @omnia/gui build + +FROM base AS runner +ENV NODE_ENV=production +RUN apt-get update -qq && \ + apt-get install -qq -y --no-install-recommends \ + python3 make g++ && \ + rm -rf /var/lib/apt/lists/* + +COPY --from=builder /app/package.json /app/pnpm-workspace.yaml ./ +COPY --from=builder /app/node_modules ./node_modules +COPY --from=builder /app/packages ./packages +COPY --from=builder /app/apps/gui/package.json \ + /app/apps/gui/next.config.ts \ + /app/apps/gui/postcss.config.mjs \ + ./apps/gui/ +COPY --from=builder /app/apps/gui/.next ./apps/gui/.next +COPY --from=builder /app/apps/gui/public ./apps/gui/public + +WORKDIR /app/apps/gui +EXPOSE 3000 +CMD ["pnpm", "start"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..9255e35 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,15 @@ +services: + omnia-gui: + build: + context: . + dockerfile: apps/gui/Dockerfile + ports: + - "3000:3000" + environment: + - NODE_ENV=production + - GOOGLE_API_KEY=${GOOGLE_API_KEY:-} + volumes: + - omnia-data:/app/apps/gui/data + +volumes: + omnia-data: From ce6b2ac6fb9ff523ba2017d524c259c05968f9ac Mon Sep 17 00:00:00 2001 From: Regina Fischer Date: Sun, 19 Jul 2026 17:38:23 +0530 Subject: [PATCH 2/2] refactor(ci): Split dockerfile into layers --- .github/workflows/build-image.yml | 12 ++++++++++++ apps/gui/Dockerfile | 20 ++++++++++++-------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 3df51f9..cd22f39 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -4,8 +4,20 @@ on: push: branches: [master] tags: ["v*"] + paths-ignore: + - 'web/docs/**' + - 'web/landing/**' + - 'content/**' + - 'README.md' + - 'CONTRIBUTING.md' + - '.github/workflows/deploy-docs.yml' pull_request: branches: [master] + paths-ignore: + - 'web/docs/**' + - 'web/landing/**' + - 'content/**' + - '*.md' workflow_dispatch: jobs: diff --git a/apps/gui/Dockerfile b/apps/gui/Dockerfile index 3d9abf6..dcd9fa3 100644 --- a/apps/gui/Dockerfile +++ b/apps/gui/Dockerfile @@ -28,9 +28,13 @@ COPY packages/spatial/package.json packages/spatial/package.json RUN --mount=type=cache,id=pnpm,target=/pnpm/store \ pnpm install --frozen-lockfile -FROM build-deps AS builder -COPY . . +FROM build-deps AS pkg-builder +COPY packages/ ./packages/ RUN pnpm build + +FROM pkg-builder AS gui-builder +COPY apps/gui/src ./apps/gui/src +COPY apps/gui/public ./apps/gui/public RUN pnpm --filter @omnia/gui build FROM base AS runner @@ -40,15 +44,15 @@ RUN apt-get update -qq && \ python3 make g++ && \ rm -rf /var/lib/apt/lists/* -COPY --from=builder /app/package.json /app/pnpm-workspace.yaml ./ -COPY --from=builder /app/node_modules ./node_modules -COPY --from=builder /app/packages ./packages -COPY --from=builder /app/apps/gui/package.json \ +COPY --from=gui-builder /app/package.json /app/pnpm-workspace.yaml ./ +COPY --from=gui-builder /app/node_modules ./node_modules +COPY --from=gui-builder /app/packages ./packages +COPY --from=gui-builder /app/apps/gui/package.json \ /app/apps/gui/next.config.ts \ /app/apps/gui/postcss.config.mjs \ ./apps/gui/ -COPY --from=builder /app/apps/gui/.next ./apps/gui/.next -COPY --from=builder /app/apps/gui/public ./apps/gui/public +COPY --from=gui-builder /app/apps/gui/.next ./apps/gui/.next +COPY --from=gui-builder /app/apps/gui/public ./apps/gui/public WORKDIR /app/apps/gui EXPOSE 3000