Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
feat: added commit hash to the version tag (#283)
Luke Zhoufa141b2d39b7
diff --git a/Dockerfile.render b/Dockerfile.rendernew file mode 100644index 0000000000..56be65fb19--- /dev/null+++ b/Dockerfile.render@@ -0,0 +1,69 @@+# *****************************************************+# * This script is for preview purpose on Render ONLY *+# *****************************************************++FROM mhart/alpine-node:14.17.3 as frontend++WORKDIR /frontend-build++# Install build dependency (e.g. vite)+COPY ./frontend/package.json ./frontend/yarn.lock ./+RUN yarn++COPY ./frontend/ .++# Build frontend+RUN yarn release-docker++FROM golang:1.16.5-alpine3.13 as backend++ARG MODE="release"+ARG VERSION="development"+ARG GO_VERSION="unknown"+ARG RENDER_GIT_COMMIT="unknown"+ARG BUILD_TIME="unknown"+ARG BUILD_USER="unknown"++# Need gcc musl-dev for CGO_ENABLED=1+RUN apk --no-cache add gcc musl-dev++WORKDIR /backend-build++COPY . .++# Copy frontend asset+COPY --from=frontend /frontend-build/dist ./server/dist++# For VERSION info+COPY ./scripts .++# -ldflags="-w -s" means omit DWARF symbol table and the symbol table and debug information+# go-sqlite3 requires CGO_ENABLED+RUN STAGING_VERSION=$`cat ./VERSION`-${RENDER_GIT_COMMIT:0:5} && CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build \+ --tags ${MODE} \+ -ldflags="-w -s -X 'github.com/bytebase/bytebase/bin/server/cmd.version=${STAGING_VERSION}' -X 'github.com/bytebase/bytebase/bin/server/cmd.goversion=${GO_VERSION}' -X 'github.com/bytebase/bytebase/bin/server/cmd.gitcommit=${RENDER_GIT_COMMIT}' -X 'github.com/bytebase/bytebase/bin/server/cmd.buildtime=${BUILD_TIME}' -X 'github.com/bytebase/bytebase/bin/server/cmd.builduser=${BUILD_USER}'" \+ -o bytebase \+ ./bin/server/main.go;++# Use alpine instead of scratch because alpine contains many basic utils and the ~10mb overhead is acceptable.+FROM alpine:3.14.0 as monolithic++ARG VERSION="development"+ARG RENDER_GIT_COMMIT="unknown"+ARG BUILD_TIME="unknown"+ARG BUILD_USER="unknown"++# See https://github.com/opencontainers/image-spec/blob/master/annotations.md+LABEL org.opencontainers.image.version=${VERSION}+LABEL org.opencontainers.image.revision=${RENDER_GIT_COMMIT}+LABEL org.opencontainers.image.created=${BUILD_TIME}+LABEL org.opencontainers.image.authors=${BUILD_USER}++COPY --from=backend /backend-build/bytebase /usr/local/bin/++# Directory to store the data, which can be referenced as the mounting point.+RUN mkdir -p /var/opt/bytebase++# Copy utility scripts, we have+# - Demo script to launch Bytebase in readonly demo mode+COPY ./scripts /usr/local/bin/