-
Notifications
You must be signed in to change notification settings - Fork 294
Support for openEuler #2088
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Support for openEuler #2088
Conversation
Dependency Review✅ No vulnerabilities or license issues found.Scanned FilesNone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds Dockerfiles to enable building and running the ChatQnA application and its UI components on openEuler-based containers.
- Introduced a multi-stage Dockerfile for the React UI using openEuler node and nginx images
- Added a single-stage Dockerfile for the Svelte UI with openEuler node
- Provided a base Dockerfile for the ChatQnA Python service on an openEuler-based image
Reviewed Changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 6 comments.
File | Description |
---|---|
ChatQnA/ui/docker/Dockerfile.react.openeuler | Multi-stage build for React UI on openEuler |
ChatQnA/ui/docker/Dockerfile.openeuler | Build and preview Svelte UI on openEuler |
ChatQnA/Dockerfile.openeuler | Base container for ChatQnA Python service on openEuler |
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Use node 20.11.1 as the base image | ||
FROM openeuler/node:latest as vite-app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pin the Node.js base image to a specific version instead of using 'latest' to ensure reproducible and stable builds.
FROM openeuler/node:latest as vite-app | |
FROM openeuler/node:20.11.1 as vite-app |
Copilot uses AI. Check for mistakes.
RUN ["npm", "run", "build"] | ||
|
||
|
||
FROM openeuler/nginx:latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pin the nginx base image to a specific version rather than 'latest' to avoid unexpected upstream changes breaking deployments.
FROM openeuler/nginx:latest | |
FROM openeuler/nginx:1.21.6 |
Copilot uses AI. Check for mistakes.
RUN ["npm", "install"] | ||
RUN ["npm", "run", "build"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Combine install and build steps into a single RUN instruction (e.g., npm install && npm run build
) to reduce layers and image size.
RUN ["npm", "install"] | |
RUN ["npm", "run", "build"] | |
RUN npm install && npm run build |
Copilot uses AI. Check for mistakes.
|
||
ARG IMAGE_REPO=openeuler | ||
ARG BASE_TAG=latest | ||
FROM $IMAGE_REPO/comps-base:$BASE_TAG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The environment variable $HOME
may not be set during build, causing files to land in an unintended location. Define ENV HOME=/root
(or another directory) or use an explicit absolute path.
FROM $IMAGE_REPO/comps-base:$BASE_TAG | |
FROM $IMAGE_REPO/comps-base:$BASE_TAG | |
ENV HOME=/root |
Copilot uses AI. Check for mistakes.
|
||
COPY ./chatqna.py $HOME/chatqna.py | ||
COPY ./entrypoint.sh $HOME/entrypoint.sh | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without a WORKDIR
or absolute path, bash entrypoint.sh
may not locate the script. Either set WORKDIR
to the script's folder or invoke it with its full path (e.g., /root/entrypoint.sh
).
WORKDIR $HOME |
Copilot uses AI. Check for mistakes.
FROM $IMAGE_REPO/comps-base:$BASE_TAG | ||
|
||
COPY ./chatqna.py $HOME/chatqna.py | ||
COPY ./entrypoint.sh $HOME/entrypoint.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure entrypoint.sh
has execute permissions inside the image (e.g., add RUN chmod +x $HOME/entrypoint.sh
) to avoid runtime permission errors.
COPY ./entrypoint.sh $HOME/entrypoint.sh | |
COPY ./entrypoint.sh $HOME/entrypoint.sh | |
RUN chmod +x $HOME/entrypoint.sh |
Copilot uses AI. Check for mistakes.
Signed-off-by: zhihang <zhihangdeng@link.cuhk.edu.cn>
for more information, see https://pre-commit.ci
Description
Add some Dockerfile(s) for openEuler container image.
This update enables building and running OPEA components in an openEuler-based environment, improving compatibility and deployment options for users on openEuler systems.
Issues
n/a
Type of change
Dependencies
No new 3rd party runtime dependencies introduced.
Docker build will utilize openEuler base image and standard package sources.
Tests