Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: update

d-bytebase8123ab984b72
diff --git a/.dockerignore b/.dockerignore
index 161f665a15..de443e2533 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,3 +1,2 @@
frontend/node_modules
-backend/server/dist
bytebase-build
diff --git a/.github/workflows/build-push-ci-image.yml b/.github/workflows/build-push-ci-image.yml
index 1a6a662b97..822998abaa 100644
--- a/.github/workflows/build-push-ci-image.yml
+++ b/.github/workflows/build-push-ci-image.yml
@@ -18,6 +18,22 @@ jobs:
echo "GIT_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
echo "BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV
echo "BUILD_USER=$(id -u -n)" >> $GITHUB_ENV
+ - uses: pnpm/[email protected]
+ with:
+ version: 8.6.0
+ - uses: actions/setup-node@v3
+ with:
+ node-version: "18"
+ cache: pnpm
+ cache-dependency-path: "frontend/pnpm-lock.yaml"
+ - run: pnpm install --frozen-lockfile
+ working-directory: frontend
+ - name: Run pnpm release build
+ run: |
+ cp ../backend/plugin/advisor/config/* ./src/types
+ cp ../backend/enterprise/api/plan.yaml ./src/types
+ pnpm release-docker
+ working-directory: frontend
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
diff --git a/scripts/Dockerfile b/scripts/Dockerfile
index e7ae6a8bec..9b4fa793d7 100644
--- a/scripts/Dockerfile
+++ b/scripts/Dockerfile
@@ -5,30 +5,7 @@
# $ docker run --init --rm --name bytebase --publish 8080:8080 --volume ~/.bytebase/data:/var/opt/bytebase bytebase/bytebase
-FROM node:18 as frontend
-RUN ulimit -n 1024000
-
-ARG TARGETARCH
-ARG RELEASE="release"
-
-RUN npm i -g pnpm
-
-WORKDIR /frontend-build
-
-# Install build dependency (e.g. vite)
-COPY ./frontend/package.json ./frontend/pnpm-lock.yaml ./
-RUN pnpm install --frozen-lockfile
-
-COPY ./frontend/ .
-# Copy the SQL review config files to the frontend
-COPY ./backend/plugin/advisor/config/ ./src/types
-COPY ./backend/enterprise/api/plan.yaml ./src/types/
-
-# Build frontend
-RUN pnpm "${RELEASE}-docker"
-
FROM golang:1.21.0 as backend
-RUN ulimit -n 1024000
ADD go.mod go.sum /
RUN go mod download
@@ -52,9 +29,6 @@ WORKDIR /backend-build
COPY . .
-# Copy frontend asset
-COPY --from=frontend /frontend-build/dist ./backend/server/dist
-
# -ldflags="-w -s" means omit DWARF symbol table and the symbol table and debug information
# go-sqlite3 requires CGO_ENABLED
RUN if [ "$TARGETARCH" = "arm64" ]; then \
@@ -68,7 +42,6 @@ fi && \
# Use debian because mysql requires glibc.
FROM debian:bookworm-slim as monolithic
-RUN ulimit -n 1024000
ARG VERSION="development"
ARG GIT_COMMIT="unknown"
diff --git a/scripts/build_bytebase_docker.sh b/scripts/build_bytebase_docker.sh
index bc69eceb30..60a87eddfa 100755
--- a/scripts/build_bytebase_docker.sh
+++ b/scripts/build_bytebase_docker.sh
@@ -12,6 +12,19 @@ cd "$(dirname "$0")/../"
echo "Start building Bytebase docker image ${VERSION}..."
+rm -r ./backend/server/dist
+
+echo "Start building Bytebase frontend"
+
+if command -v pnpm > /dev/null
+then
+ pnpm --dir ./frontend i && pnpm --dir ./frontend release
+else
+ npm --prefix ./frontend run release
+fi
+
+echo "Completed building Bytebase frontend."
+
docker build -f ./scripts/Dockerfile \
--build-arg VERSION=${VERSION} \
--build-arg GO_VERSION="$(go version)" \