feat(docker): streamline frontend build process and update Docker configuration
- Added a new script `build_frontend_dist.sh` to handle the building of frontend static assets. - Updated `docker-compose.yml` to include a note about running the build script before building the frontend service. - Modified the GitHub Actions workflow to integrate the new build script for frontend assets. - Adjusted the Dockerfile to copy built assets directly from the `dist` directory. - Refined the `.dockerignore` to exclude unnecessary files while keeping the `dist` directory.
This commit is contained in:
@@ -187,11 +187,13 @@ build_frontend_image() {
|
||||
|
||||
# 获取版本信息(用于注入前端 commit hash)
|
||||
get_version_info
|
||||
|
||||
|
||||
log_info "构建前端静态资源..."
|
||||
VITE_IS_DOCKER=true VITE_FRONTEND_COMMIT="$COMMIT_ID" "$SCRIPT_DIR/build_frontend_dist.sh"
|
||||
|
||||
docker build \
|
||||
--platform $PLATFORM \
|
||||
-f frontend/Dockerfile \
|
||||
--build-arg COMMIT_ID_ARG="$COMMIT_ID" \
|
||||
-t wechatopenai/weknora-ui:latest \
|
||||
frontend/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user