Skip to content

Comments

feat(docker): heidi-cli image with bundled UI#81

Merged
heidi-dang merged 1 commit intomainfrom
feat/docker-heidi-cli-v2
Feb 17, 2026
Merged

feat(docker): heidi-cli image with bundled UI#81
heidi-dang merged 1 commit intomainfrom
feat/docker-heidi-cli-v2

Conversation

@heidi-dang
Copy link
Owner

Summary

  • Adds multi-stage Docker build for heidi-cli that bundles the Vite UI dist and serves it at /ui via the FastAPI backend.

What Changed

  • Stage 1 (Node): builds ui/dist with base=/ui/
  • Stage 2 (Python): installs heidi-cli and copies ui/dist into the runtime image
  • Runtime serves FastAPI on :7777 and /ui/
  • Adds docs: docs/DOCKER_HEIDI_CLI.md

How to Test

docker build -t heididang/heidi-cli:dev .
docker run --rm -p 7777:7777 heididang/heidi-cli:dev
curl -i http://localhost:7777/health
curl -i http://localhost:7777/ui/

Notes

  • No secrets baked into image
  • HEIDI_NO_WIZARD=1 to skip interactive setup

@gemini-code-assist
Copy link

Summary of Changes

Hello @heidi-dang, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant enhancement to the heidi-cli Docker image by integrating its user interface directly into the application container. This change streamlines deployment by providing a single, self-contained image that includes both the backend and the pre-built frontend, simplifying setup and ensuring version compatibility between the UI and the API.

Highlights

  • Multi-stage Docker Build: Implemented a multi-stage Dockerfile to separate the UI build process from the final application image, optimizing image size and build dependencies.
  • UI Bundling: Integrated a dedicated Node.js stage to build the Vite UI distribution, which is then copied into the final Python application image.
  • Runtime UI Serving: Configured the Docker build to include the compiled UI assets, enabling the FastAPI backend to serve the UI at the '/ui/' path.
Changelog
  • Dockerfile
    • Added a new 'ui-builder' stage using Node.js 22-alpine to build the UI assets.
    • Configured the UI build process to output assets with a base path of '/ui/'.
    • Copied the compiled UI distribution from the 'ui-builder' stage into the main Python application image at '/app/heidi_cli/ui_dist'.
Activity
  • No human activity (comments, reviews) has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a multi-stage Docker build to bundle the Vite-based UI with the heidi-cli application, which is a great enhancement. The overall structure of the Dockerfile is good. My review provides suggestions to align the Dockerfile with best practices for creating smaller, more secure, and reproducible container images. This includes pinning base image versions, avoiding broad COPY commands, and using standard package installation methods for production images.


COPY --from=ui-builder /app/ui/dist /app/heidi_cli/ui_dist

COPY . .

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The COPY . . command copies the entire build context into the image, including files not needed for runtime like the ui source, development scripts, and the Dockerfile itself. This unnecessarily increases the final image size and can be a security risk. It is strongly recommended to use a .dockerignore file to exclude these files, or replace this with specific COPY commands for only the necessary application source code (e.g., COPY src ./src and COPY pyproject.toml .).

@@ -1,3 +1,13 @@
FROM node:22-alpine AS ui-builder

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For more reproducible and secure builds, it's a best practice to pin the base image to a specific version (e.g., node:22.4.0-alpine) rather than using a floating tag like 22-alpine. This prevents unexpected changes or build failures if the base image tag is updated.

FROM node:22.4.0-alpine AS ui-builder


COPY . .

RUN pip install --no-cache-dir -e .

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

An editable install (-e) is suitable for development, but for a production Docker image, a standard installation is preferred. A standard install creates a more immutable and potentially optimized environment, which is desirable for a distributable image. Consider changing this to a standard pip install . for the final image.

RUN pip install --no-cache-dir .

@heidi-dang heidi-dang merged commit aa655d1 into main Feb 17, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant