diff --git a/.github/workflows/postgres-build.yml b/.github/workflows/postgres-build.yml deleted file mode 100644 index 6fd8b070..00000000 --- a/.github/workflows/postgres-build.yml +++ /dev/null @@ -1,80 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle - -name: Postgresql Build -run-name: ${{ github.actor }} is Build Postgresql Actions -on: - push: - branches: [ "main","dev" ] - tags: - - "v*.*.*" - pull_request: - -env: - # Use docker.io for Docker Hub if empty - REGISTRY: ghcr.io - # github.repository as / - IMAGE_NAME: postgres - # Postgresql version - POSTGRES_VERSION: 17 -jobs: - build-image: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - attestations: write - id-token: write - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - # Extract metadata (tags, labels) for Docker - # https://github.com/docker/metadata-action - - name: Extract Docker metadata - id: meta - uses: docker/metadata-action@v5 - with: - images: | - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - # generate Docker tags based on the following events/attributes - tags: | - type=schedule - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=sha - - - name: Docker Setup Buildx - uses: docker/setup-buildx-action@v3 - - - name: Log into registry ${{ env.REGISTRY }} - if: github.event_name != 'pull_request' - uses: docker/login-action@v3.3.0 - with: - registry: ${{ env.REGISTRY }} - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and push Docker Local images - uses: docker/build-push-action@v6 - with: - context: ./boot/postgres - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - - - name: Build zhparser Docker image - run: docker buildx build --push -t ${{ vars.DOCKER_PREFIX }}/postgres:17-zhparser ./boot/postgres/zhparser - - - name: Build postgis Docker image - run: docker buildx build --push -t ${{ vars.DOCKER_PREFIX }}/postgres:17-postgis ./boot/postgres/postgis - - - name: Build latest Docker image - run: docker buildx build --push -t ${{ vars.DOCKER_PREFIX }}/postgres:latest ./boot/postgres/postgis diff --git a/boot/postgres/Dockerfile b/boot/postgres/Dockerfile deleted file mode 100644 index ba20599d..00000000 --- a/boot/postgres/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM postgres:17 - -# 设置时区 -RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime -RUN localedef -i zh_CN -c -f UTF-8 -A /usr/share/locale/locale.alias zh_CN.UTF-8 -RUN localedef -i zh_HK -c -f UTF-8 -A /usr/share/locale/locale.alias zh_HK.UTF-8 -RUN localedef -i zh_TW -c -f UTF-8 -A /usr/share/locale/locale.alias zh_TW.UTF-8 -ENV LANG=zh_CN.utf8 diff --git a/boot/postgres/postgis/Dockerfile b/boot/postgres/postgis/Dockerfile deleted file mode 100644 index 7236e617..00000000 --- a/boot/postgres/postgis/Dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -ARG PG_CONTAINER_VERSION=latest -FROM postgis/postgis:${PG_CONTAINER_VERSION} AS builder - -ARG DEBIAN_FRONTEND=noninteractive -RUN set -ex \ - && apt-get update \ - && apt-get install -y build-essential git postgresql-server-dev-${PG_MAJOR} pkg-config binutils automake libtool \ - && apt-get clean - -RUN set -ex \ - && git clone --branch 1.2.3 --single-branch --depth 1 https://github.com/hightman/scws.git \ - && cd scws \ - && touch README;aclocal;autoconf;autoheader;libtoolize;automake --add-missing \ - && ./configure \ - && make install - -RUN set -ex \ - && git clone --branch master --single-branch --depth 1 https://github.com/amutu/zhparser.git \ - && cd zhparser \ - && make install - -FROM postgis/postgis:${PG_CONTAINER_VERSION} -RUN localedef -i zh_CN -c -f UTF-8 -A /usr/share/locale/locale.alias zh_CN.UTF-8 -ENV LANG=zh_CN.UTF-8 - -COPY --from=builder /usr/lib/postgresql/${PG_MAJOR}/lib/zhparser.so /usr/lib/postgresql/${PG_MAJOR}/lib/ -COPY --from=builder /usr/local/lib/libscws.* /usr/local/lib/ -COPY --from=builder /usr/share/postgresql/${PG_MAJOR}/extension/zhparser* /usr/share/postgresql/${PG_MAJOR}/extension/ -COPY --from=builder /usr/lib/postgresql/${PG_MAJOR}/lib/bitcode/zhparser* /usr/lib/postgresql/${PG_MAJOR}/lib/bitcode/ -COPY --from=builder /usr/share/postgresql/${PG_MAJOR}/tsearch_data/*.utf8.* /usr/share/postgresql/${PG_MAJOR}/tsearch_data/ - diff --git a/boot/postgres/zhparser/Dockerfile b/boot/postgres/zhparser/Dockerfile deleted file mode 100644 index 7aedb540..00000000 --- a/boot/postgres/zhparser/Dockerfile +++ /dev/null @@ -1,30 +0,0 @@ -ARG PG_CONTAINER_VERSION=17 -FROM docker.io/library/postgres:${PG_CONTAINER_VERSION}-bookworm AS builder - -ARG DEBIAN_FRONTEND=noninteractive -RUN set -ex \ - && apt-get update \ - && apt-get install -y build-essential git postgresql-server-dev-${PG_MAJOR} pkg-config binutils automake libtool \ - && apt-get clean - -RUN set -ex \ - && git clone --branch 1.2.3 --single-branch --depth 1 https://github.com/hightman/scws.git \ - && cd scws \ - && touch README;aclocal;autoconf;autoheader;libtoolize;automake --add-missing \ - && ./configure \ - && make install - -RUN set -ex \ - && git clone --branch master --single-branch --depth 1 https://github.com/amutu/zhparser.git \ - && cd zhparser \ - && make install - -FROM docker.io/library/postgres:${PG_CONTAINER_VERSION}-bookworm -RUN localedef -i zh_CN -c -f UTF-8 -A /usr/share/locale/locale.alias zh_CN.UTF-8 -ENV LANG=zh_CN.UTF-8 - -COPY --from=builder /usr/lib/postgresql/${PG_MAJOR}/lib/zhparser.so /usr/lib/postgresql/${PG_MAJOR}/lib/ -COPY --from=builder /usr/local/lib/libscws.* /usr/local/lib/ -COPY --from=builder /usr/share/postgresql/${PG_MAJOR}/extension/zhparser* /usr/share/postgresql/${PG_MAJOR}/extension/ -COPY --from=builder /usr/lib/postgresql/${PG_MAJOR}/lib/bitcode/zhparser* /usr/lib/postgresql/${PG_MAJOR}/lib/bitcode/ -COPY --from=builder /usr/share/postgresql/${PG_MAJOR}/tsearch_data/*.utf8.* /usr/share/postgresql/${PG_MAJOR}/tsearch_data/ \ No newline at end of file