Skip to content

feat: add dockerfile for backend - #67

Open
0PrashantYadav0 wants to merge 2 commits into
kubeedge:mainfrom
0PrashantYadav0:feat/dockerfile
Open

feat: add dockerfile for backend#67
0PrashantYadav0 wants to merge 2 commits into
kubeedge:mainfrom
0PrashantYadav0:feat/dockerfile

Conversation

@0PrashantYadav0

Copy link
Copy Markdown

What type of PR is this?

/kind documentation
/kind feature

What this PR does / why we need it:

  • Adds a production-grade multi-stage Dockerfile for the API module (BFF) at modules/api/Dockerfile
    • Static Go binary, distroless non-root runtime, exposes 8080, sensible defaults, OCI labels.
  • Updates README.md with clear Docker build/run instructions for both API and Web

Which issue(s) this PR fixes:
Fixes #65

Special notes for your reviewer:

  • API image build context is the repo root (uses Go workspace and local replace directives).
  • Default container command binds API to 0.0.0.0:8080.
  • Web proxies /api/* to ${API_SERVER}/api/v1/* and forwards /keink/*.

Does this PR introduce a user-facing change?:

Add production Dockerfile for API (BFF) at modules/api/Dockerfile.
Update README with Docker build/run instructions for API and Web.
Default API listens on 8080 inside the container; set API_SERVER in Web container to reach it.

@kubeedge-bot kubeedge-bot added kind/documentation Categorizes issue or PR as related to documentation. kind/feature Categorizes issue or PR as related to a new feature. labels Aug 8, 2025
@kubeedge-bot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign fisherxu after the PR has been reviewed.
You can assign the PR to them by writing /assign @fisherxu in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubeedge-bot

Copy link
Copy Markdown
Collaborator

Welcome @0PrashantYadav0! It looks like this is your first PR to kubeedge/dashboard 🎉

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary of Changes

Hello @0PrashantYadav0, 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!

I've added a production-grade multi-stage Dockerfile for the API module, enabling containerized deployment of the backend. This change also includes comprehensive updates to the README.md to provide clear instructions for building and running both the API and Web modules using Docker, alongside existing local development guidelines.

Highlights

  • API Dockerization: Introduced a new Dockerfile for the API module (modules/api/Dockerfile), creating a production-grade, multi-stage build.
  • Optimized Docker Image: The API Docker image is built as a static Go binary, uses a distroless non-root runtime for security and minimal size, exposes port 8080, and includes OCI labels for better image metadata.
  • Updated Documentation: The README.md has been significantly updated to include detailed instructions for building and running both the API and Web modules using Docker, complementing the existing local development setup.
  • Container Configuration: The API image build context is set to the repository root to leverage Go workspaces, and the default container command binds the API to 0.0.0.0:8080.
  • Web Proxying: The Web module is configured to proxy /api/* to ${API_SERVER}/api/v1/* and forward /keink/*, ensuring proper communication with the API container.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 or fill out our survey to provide feedback.

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.

@kubeedge-bot kubeedge-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 8, 2025

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

Copy link
Copy Markdown

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 introduces a production-grade, multi-stage Dockerfile for the API backend and updates the README with comprehensive instructions for building and running both the API and Web components using Docker. The changes are well-structured and follow good practices like using distroless, non-root images. My review includes suggestions to improve Docker layer caching for faster builds, a minor shell scripting improvement in the README, and a formatting fix for the Dockerfile.

Comment thread README.md Outdated
Comment thread modules/api/Dockerfile
Comment thread modules/api/Dockerfile Outdated
Signed-off-by: JoyBoy <144602492+0PrashantYadav0@users.noreply.github.com>
Signed-off-by: JoyBoy <144602492+0PrashantYadav0@users.noreply.github.com>
@0PrashantYadav0

Copy link
Copy Markdown
Author

@kevin-wangzefeng Please review and merge this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/documentation Categorizes issue or PR as related to documentation. kind/feature Categorizes issue or PR as related to a new feature. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dockerize the api module

2 participants