From c24a9f707acc1ad0b6a942a6a67af214832dfc15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ALEXANDER=20QUADRATUS=20/=E1=BC=88=CE=BB=CE=AD=CE=BE=CE=B1?= =?UTF-8?q?=CE=BD=CE=B4=CF=81=CE=BF=CF=82=20=CE=9A=CE=BF=CE=B4=CF=81?= =?UTF-8?q?=E1=BE=B6=CF=84=CE=BF=CF=82/?= Date: Fri, 28 Apr 2023 14:12:34 +0700 Subject: [PATCH 01/14] create production branch --- .github/workflows/dataserver-image.yml | 27 -------- .github/workflows/dataserver-php.yml | 82 ------------------------ .github/workflows/streamserver-image.yml | 35 ---------- README.md | 2 +- 4 files changed, 1 insertion(+), 145 deletions(-) delete mode 100644 .github/workflows/dataserver-image.yml delete mode 100644 .github/workflows/dataserver-php.yml delete mode 100644 .github/workflows/streamserver-image.yml diff --git a/.github/workflows/dataserver-image.yml b/.github/workflows/dataserver-image.yml deleted file mode 100644 index 35600f2c..00000000 --- a/.github/workflows/dataserver-image.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Dataserver Image CI - -on: - push: - paths: - - docker/dataserver/** - - ds.Dockerfile - - .github/workflows/dataserver-image.yml - branches: [ "new_dev" ] - - pull_request: - branches: [ "new_dev" ] - paths: - - docker/dataserver/** - - ds.Dockerfile - - .github/workflows/dataserver-image.yml - -jobs: - - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Build the Docker image - run: docker build . --file ds.Dockerfile --tag app-zotprime-dataserver:$(date +%s) \ No newline at end of file diff --git a/.github/workflows/dataserver-php.yml b/.github/workflows/dataserver-php.yml deleted file mode 100644 index 5b6b6895..00000000 --- a/.github/workflows/dataserver-php.yml +++ /dev/null @@ -1,82 +0,0 @@ -name: Dataserver PHP Composer - -on: - push: - branches: [ "new_dev" ] - paths: - - dataserver/** - - .github/workflows/dataserver-php.yml - pull_request: - branches: [ "new_dev" ] - paths: - - dataserver/** - - .github/workflows/dataserver-php.yml -permissions: - contents: read - - - -#defaults: -# run: -# working-directory: ./dataserver - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - php-version: - - "7.4" - - dependencies: - - "locked" - - - steps: - - uses: actions/checkout@v3 - - - name: Install PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - - - name: Checkout submodules - run: git submodule update --init dataserver - - - name: Validate composer.json and composer.lock - working-directory: ./dataserver - run: composer validate --strict - - - - name: "Determine composer cache directory" - id: "determine-composer-cache-directory" - working-directory: ./dataserver - run: "echo \"::set-output name=directory::$(composer config cache-dir)\"" - - - name: "Cache dependencies installed with composer" - uses: "actions/cache@v3" - with: - path: "dataserver${{ steps.determine-composer-cache-directory.outputs.directory }}" - key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" - restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" - - -# - name: Cache Composer packages -# id: composer-cache -# uses: actions/cache@v3 -# with: -# path: vendor -# key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} -# restore-keys: | -# ${{ runner.os }}-php- - - - name: Install dependencies - working-directory: ./dataserver - run: composer install --prefer-dist --no-progress - - # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" - # Docs: https://getcomposer.org/doc/articles/scripts.md - - # - name: Run test suite \ No newline at end of file diff --git a/.github/workflows/streamserver-image.yml b/.github/workflows/streamserver-image.yml deleted file mode 100644 index 1b959853..00000000 --- a/.github/workflows/streamserver-image.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Streamserver Image CI - -on: - push: - paths: - - stream-server/** - - docker/stream-server/** - - .github/workflows/streamserver-image.yml - branches: [ "new_dev" ] - - pull_request: - branches: [ "new_dev" ] - paths: - - stream-server/** - - docker/stream-server/** - - .github/workflows/streamserver-image.yml - - -jobs: - - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Checkout submodules - run: git submodule update --init stream-server - - name: Build the Docker image -# working-directory: ./stream-server - run: docker build . --file sts.Dockerfile --tag app-zotprime-streamserver:$(date +%s) -# uses: docker/build-push-action@v2 -# with: -# context: . -# file: Dockerfile diff --git a/README.md b/README.md index 0e32f2ed..8380d1ac 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ $ n 16.20.0 ```bash $ mkdir /path/to/your/app && cd /path/to/your/app $ git clone --recursive https://github.com/uniuuu/zotprime.git -$ git checkout tags/ -b +$ git checkout production $ cd zotprime ``` From e77da822db0993443ea144a1e7a4e1c6f6004f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ALEXANDER=20QUADRATUS=20/=E1=BC=88=CE=BB=CE=AD=CE=BE=CE=B1?= =?UTF-8?q?=CE=BD=CE=B4=CF=81=CE=BF=CF=82=20=CE=9A=CE=BF=CE=B4=CF=81?= =?UTF-8?q?=E1=BE=B6=CF=84=CE=BF=CF=82/?= Date: Fri, 28 Apr 2023 20:08:17 +0700 Subject: [PATCH 02/14] Draft: Added script to apply db_updates --- bin/init.sh | 1 + docker-compose.yml | 1 + docker/dataserver/dbinit/db_update.sh | 11 +++++++++++ 3 files changed, 13 insertions(+) create mode 100755 docker/dataserver/dbinit/db_update.sh diff --git a/bin/init.sh b/bin/init.sh index 9a7813b1..db9d03bb 100755 --- a/bin/init.sh +++ b/bin/init.sh @@ -3,6 +3,7 @@ set -eux sudo docker compose exec app-zotprime-dataserver bash -cux 'cd /var/www/zotero/misc && ./init-mysql.sh' +#sudo docker compose exec app-zotprime-dataserver bash -cux 'cd /var/www/zotero/misc && ./db_update.sh' sudo docker compose exec app-zotprime-dataserver bash -cux 'aws --endpoint-url "http://minio:9000" s3 mb s3://zotero' sudo docker compose exec app-zotprime-dataserver bash -cux 'aws --endpoint-url "http://minio:9000" s3 mb s3://zotero-fulltext' sudo docker compose exec app-zotprime-dataserver bash -cux 'aws --endpoint-url "http://localstack:4575" sns create-topic --name zotero' diff --git a/docker-compose.yml b/docker-compose.yml index b570ad2b..8d039e86 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -63,6 +63,7 @@ services: - "./docker/dataserver/config/header.inc.php:/var/www/zotero/include/header.inc.php:ro" - "./docker/dataserver/config/Storage.inc.php:/var/www/zotero/model/Storage.inc.php:ro" - "./docker/dataserver/dbinit/init-mysql.sh:/var/www/zotero/misc/init-mysql.sh:ro" +# - "./docker/dataserver/dbinit/db_update.sh:/var/www/zotero/misc/db_update.sh:ro" - "./docker/dataserver/dbinit/www.sql:/var/www/zotero/misc/www.sql:ro" - "./docker/dataserver/dbinit/shard.sql:/var/www/zotero/misc/shard.sql:ro" - "./docker/dataserver/config/create-user.sh:/var/www/zotero/admin/create-user.sh:ro" diff --git a/docker/dataserver/dbinit/db_update.sh b/docker/dataserver/dbinit/db_update.sh new file mode 100755 index 00000000..b1d73ebd --- /dev/null +++ b/docker/dataserver/dbinit/db_update.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -xue + +for i in db-updates/*/; do + cd /var/www/zotero/misc/$i + for j in *; do + find . -type f \( ! -name *.sql \) -exec php {} \; + find . -type f -name *.sql -exec bash -c 'mysql -h mysql -P 3306 -u root -pzotero zotero_master < {}' \; + done +done; +cd ../../ \ No newline at end of file From 80c5299520ae34af0bece7698c75e27ed00832cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ALEXANDER=20QUADRATUS=20/=E1=BC=88=CE=BB=CE=AD=CE=BE=CE=B1?= =?UTF-8?q?=CE=BD=CE=B4=CF=81=CE=BF=CF=82=20=CE=9A=CE=BF=CE=B4=CF=81?= =?UTF-8?q?=E1=BE=B6=CF=84=CE=BF=CF=82/?= Date: Fri, 28 Apr 2023 20:29:34 +0700 Subject: [PATCH 03/14] fix client config --- client/config.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/config.sh b/client/config.sh index 957b919e..1ea077c9 100755 --- a/client/config.sh +++ b/client/config.sh @@ -1,5 +1,9 @@ #!/bin/sh +set -eux + +sed -i "s#'http://zotero.org/'#'http://localhost:8080/'#g" zotero-client/resource/config.js +sed -i "s#'zotero.org'#'localhost'#g" zotero-client/resource/config.js sed -i 's#https://api.zotero.org/#http://localhost:8080/#g' zotero-client/resource/config.js sed -i 's#wss://stream.zotero.org/#ws://localhost:8081/#g' zotero-client/resource/config.js sed -i 's#https://www.zotero.org/#http://localhost:8080/#g' zotero-client/resource/config.js From 0046f36c89dac85889ae1168ffeb3cb86e78faa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ALEXANDER=20QUADRATUS=20/=E1=BC=88=CE=BB=CE=AD=CE=BE=CE=B1?= =?UTF-8?q?=CE=BD=CE=B4=CF=81=CE=BF=CF=82=20=CE=9A=CE=BF=CE=B4=CF=81?= =?UTF-8?q?=E1=BE=B6=CF=84=CE=BF=CF=82/?= Date: Fri, 28 Apr 2023 20:57:29 +0700 Subject: [PATCH 04/14] Draft: Adding clinet build in docker --- client.Dockerfile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 client.Dockerfile diff --git a/client.Dockerfile b/client.Dockerfile new file mode 100644 index 00000000..c9e37ff7 --- /dev/null +++ b/client.Dockerfile @@ -0,0 +1,24 @@ + +FROM node:16-alpine as intermediate + +WORKDIR /usr/src/app +#RUN mkdir -p /build +COPY ./client . +RUN set -eux; \ + ./config.sh +WORKDIR /usr/src/app/zotero-client +RUN set -eux; \ + npm install +RUN set -eux; \ + npm run build +WORKDIR /usr/src/app/zotero-standalone-build +RUN set -eux; \ + ./fetch_xulrunner.sh -p l +RUN set -eux; \ + ./fetch_pdftools +RUN set -eux; \ + ./scripts/dir_build -p l + + +FROM scratch AS export-stage +COPY --from=intermediate /usr/src/app/zotero-standalone-build/staging/* . \ No newline at end of file From 2ea25de20fca466925e38ea07ed841c66eab61b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ALEXANDER=20QUADRATUS=20/=E1=BC=88=CE=BB=CE=AD=CE=BE=CE=B1?= =?UTF-8?q?=CE=BD=CE=B4=CF=81=CE=BF=CF=82=20=CE=9A=CE=BF=CE=B4=CF=81?= =?UTF-8?q?=E1=BE=B6=CF=84=CE=BF=CF=82/?= Date: Fri, 28 Apr 2023 21:26:36 +0700 Subject: [PATCH 05/14] Clinet building in docker. Minio stick to self built. Stream-server update dockerfile. --- client.Dockerfile | 18 +++++++++++------- client.Dockerfile.dockerignore | 26 ++++++++++++++++++++++++++ docker-compose.yml | 2 +- sts.Dockerfile | 2 +- 4 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 client.Dockerfile.dockerignore diff --git a/client.Dockerfile b/client.Dockerfile index c9e37ff7..650b7463 100644 --- a/client.Dockerfile +++ b/client.Dockerfile @@ -1,23 +1,27 @@ FROM node:16-alpine as intermediate +RUN set -eux; \ + apk add --update --no-cache git WORKDIR /usr/src/app #RUN mkdir -p /build COPY ./client . RUN set -eux; \ ./config.sh -WORKDIR /usr/src/app/zotero-client +#WORKDIR /usr/src/app/zotero-client RUN set -eux; \ - npm install + npx browserslist@latest --update-db RUN set -eux; \ - npm run build -WORKDIR /usr/src/app/zotero-standalone-build + cd /usr/src/app/zotero-client && npm install RUN set -eux; \ - ./fetch_xulrunner.sh -p l + cd /usr/src/app/zotero-client && npm run build +#WORKDIR /usr/src/app/zotero-standalone-build RUN set -eux; \ - ./fetch_pdftools + cd /usr/src/app/zotero-standalone-build && ./fetch_xulrunner.sh -p l RUN set -eux; \ - ./scripts/dir_build -p l + cd /usr/src/app/zotero-standalone-build && ./fetch_pdftools +RUN set -eux; \ + cd /usr/src/app/zotero-standalone-build && ./scripts/dir_build -p l FROM scratch AS export-stage diff --git a/client.Dockerfile.dockerignore b/client.Dockerfile.dockerignore new file mode 100644 index 00000000..9b7a4106 --- /dev/null +++ b/client.Dockerfile.dockerignore @@ -0,0 +1,26 @@ +clinet/zotero-clinet/.DS_Store +clinet/zotero-clinet/node_modules +clinet/zotero-clinet/build +clinet/zotero-clinet/.signatures.json +clinet/zotero-clinet/tmp +clinet/zotero-build/config.sh +clinet/zotero-build/node_modules +clinet/zotero-standalone-build/*~ +clinet/zotero-standalone-build/cache +clinet/zotero-standalone-build/config-custom.sh +clinet/zotero-standalone-build/dist +clinet/zotero-standalone-build/staging +clinet/zotero-standalone-build/xulrunner +clinet/zotero-standalone-build/pdftools +.git +.github +bin +dataserver +doc +docker/dataserver +docker/minio +stream-server +tinymce-clean-server +Zend +docker-compose.yml + diff --git a/docker-compose.yml b/docker-compose.yml index 8d039e86..4168b250 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,7 +38,7 @@ services: environment: - SERVICES=sns,sqs,apigateway db-zotprime-minio: - image: minio/minio +# image: minio/minio build: context: . dockerfile: minio.Dockerfile diff --git a/sts.Dockerfile b/sts.Dockerfile index 01ed5201..41dd92f8 100644 --- a/sts.Dockerfile +++ b/sts.Dockerfile @@ -1,6 +1,6 @@ FROM node:8.9-alpine -RUN apk add --update \ +RUN apk add --update --no-cache \ libc6-compat WORKDIR /usr/src/app From feb305d84616ab8ef7a546b72f41b856446da79c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ALEXANDER=20QUADRATUS=20/=E1=BC=88=CE=BB=CE=AD=CE=BE=CE=B1?= =?UTF-8?q?=CE=BD=CE=B4=CF=81=CE=BF=CF=82=20=CE=9A=CE=BF=CE=B4=CF=81?= =?UTF-8?q?=E1=BE=B6=CF=84=CE=BF=CF=82/?= Date: Sat, 29 Apr 2023 11:13:06 +0700 Subject: [PATCH 06/14] Pulled down update to submodules --- client/zotero-client | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/zotero-client b/client/zotero-client index fb61ea4b..25ec3238 160000 --- a/client/zotero-client +++ b/client/zotero-client @@ -1 +1 @@ -Subproject commit fb61ea4ba239f9c748b6345e159b88b7ca57dbf3 +Subproject commit 25ec32380af225270a38796e0ddb69c2c427204e From b5a8bfcd00366ba2a26df5bd2519e38e7e92b4a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ALEXANDER=20QUADRATUS=20/=E1=BC=88=CE=BB=CE=AD=CE=BE=CE=B1?= =?UTF-8?q?=CE=BD=CE=B4=CF=81=CE=BF=CF=82=20=CE=9A=CE=BF=CE=B4=CF=81?= =?UTF-8?q?=E1=BE=B6=CF=84=CE=BF=CF=82/?= Date: Sat, 29 Apr 2023 11:40:24 +0700 Subject: [PATCH 07/14] Pulled down update to submodules --- client/zotero-client | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/zotero-client b/client/zotero-client index 25ec3238..be4ad10a 160000 --- a/client/zotero-client +++ b/client/zotero-client @@ -1 +1 @@ -Subproject commit 25ec32380af225270a38796e0ddb69c2c427204e +Subproject commit be4ad10ae9aa6ed350ea69c4cba3aba40c7b6074 From 341fab08d250244d6d968c7d1c09290ee564325f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ALEXANDER=20QUADRATUS=20/=E1=BC=88=CE=BB=CE=AD=CE=BE=CE=B1?= =?UTF-8?q?=CE=BD=CE=B4=CF=81=CE=BF=CF=82=20=CE=9A=CE=BF=CE=B4=CF=81?= =?UTF-8?q?=E1=BE=B6=CF=84=CE=BF=CF=82/?= Date: Sat, 29 Apr 2023 12:07:41 +0700 Subject: [PATCH 08/14] Added Clinet Build Test CI --- .github/workflows/client-build-test.yml | 27 +++++++++++++++ client.Dockerfile | 32 +++++++++++------- client.Dockerfile.dockerignore | 4 +-- clientbuildtest.Dockerfile | 44 +++++++++++++++++++++++++ clientbuildtest.Dockerfile.dockerignore | 10 ++++++ 5 files changed, 103 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/client-build-test.yml create mode 100644 clientbuildtest.Dockerfile create mode 100644 clientbuildtest.Dockerfile.dockerignore diff --git a/.github/workflows/client-build-test.yml b/.github/workflows/client-build-test.yml new file mode 100644 index 00000000..02a1a3f8 --- /dev/null +++ b/.github/workflows/client-build-test.yml @@ -0,0 +1,27 @@ +name: Client Test Build + +on: + push: + paths: + - client/** + - clientbuildtest.Dockerfile + - .github/workflows/client-build-test.yml + branches: [ "new_dev" ] + + pull_request: + branches: [ "new_dev" ] + paths: + - client/** + - clientbuildtest.Dockerfile + - .github/workflows/client-build-test.yml + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build Client + run: DOCKER_BUILDKIT=1 docker build . --file clientbuildtest.Dockerfile --output build --tag client:$(date +%s) \ No newline at end of file diff --git a/client.Dockerfile b/client.Dockerfile index 650b7463..72d31026 100644 --- a/client.Dockerfile +++ b/client.Dockerfile @@ -2,26 +2,36 @@ FROM node:16-alpine as intermediate RUN set -eux; \ - apk add --update --no-cache git + apk add --update --no-cache git \ + && rm -rf /var/cache/apk/* + WORKDIR /usr/src/app -#RUN mkdir -p /build -COPY ./client . + +COPY . . +RUN git submodule update --init --recursive +WORKDIR /usr/src/app/client/ RUN set -eux; \ ./config.sh -#WORKDIR /usr/src/app/zotero-client +WORKDIR /usr/src/app/client/zotero-client RUN set -eux; \ - npx browserslist@latest --update-db + #cd /usr/src/app/zotero-client && + npx browserslist@latest --update-db RUN set -eux; \ - cd /usr/src/app/zotero-client && npm install + #cd /usr/src/app/zotero-client && + npm install RUN set -eux; \ - cd /usr/src/app/zotero-client && npm run build -#WORKDIR /usr/src/app/zotero-standalone-build + #cd /usr/src/app/zotero-client && + npm run build +WORKDIR /usr/src/app/client/zotero-standalone-build RUN set -eux; \ - cd /usr/src/app/zotero-standalone-build && ./fetch_xulrunner.sh -p l + #cd /usr/src/app/zotero-standalone-build && + ./fetch_xulrunner.sh -p l RUN set -eux; \ - cd /usr/src/app/zotero-standalone-build && ./fetch_pdftools + #cd /usr/src/app/zotero-standalone-build && + ./fetch_pdftools RUN set -eux; \ - cd /usr/src/app/zotero-standalone-build && ./scripts/dir_build -p l + #cd /usr/src/app/zotero-standalone-build && + ./scripts/dir_build -p l FROM scratch AS export-stage diff --git a/client.Dockerfile.dockerignore b/client.Dockerfile.dockerignore index 9b7a4106..d9a47539 100644 --- a/client.Dockerfile.dockerignore +++ b/client.Dockerfile.dockerignore @@ -12,13 +12,11 @@ clinet/zotero-standalone-build/dist clinet/zotero-standalone-build/staging clinet/zotero-standalone-build/xulrunner clinet/zotero-standalone-build/pdftools -.git .github bin dataserver doc -docker/dataserver -docker/minio +docker stream-server tinymce-clean-server Zend diff --git a/clientbuildtest.Dockerfile b/clientbuildtest.Dockerfile new file mode 100644 index 00000000..cb13f123 --- /dev/null +++ b/clientbuildtest.Dockerfile @@ -0,0 +1,44 @@ + +FROM node:16-alpine as intermediate + +RUN set -eux; \ + apk add --update --no-cache git \ + && rm -rf /var/cache/apk/* + +WORKDIR /usr/src/app +RUN mkdir client +RUN cd client +RUN git init +RUN git remote add -f origin https://github.com/uniuuu/zotprime +RUN echo "client/" >> .git/info/sparse-checkout +RUN git pull origin new_dev +RUN git submodule update --init --recursive + +#COPY . . +WORKDIR /usr/src/app/client/ +RUN set -eux; \ + ./config.sh +WORKDIR /usr/src/app/client/zotero-client +RUN set -eux; \ + #cd /usr/src/app/zotero-client && + npx browserslist@latest --update-db +RUN set -eux; \ + #cd /usr/src/app/zotero-client && + npm install +RUN set -eux; \ + #cd /usr/src/app/zotero-client && + npm run build +WORKDIR /usr/src/app/client/zotero-standalone-build +RUN set -eux; \ + #cd /usr/src/app/zotero-standalone-build && + ./fetch_xulrunner.sh -p l +RUN set -eux; \ + #cd /usr/src/app/zotero-standalone-build && + ./fetch_pdftools +RUN set -eux; \ + #cd /usr/src/app/zotero-standalone-build && + ./scripts/dir_build -p l + + +FROM scratch AS export-stage +COPY --from=intermediate /usr/src/app/zotero-standalone-build/staging/* . \ No newline at end of file diff --git a/clientbuildtest.Dockerfile.dockerignore b/clientbuildtest.Dockerfile.dockerignore new file mode 100644 index 00000000..8a91bb00 --- /dev/null +++ b/clientbuildtest.Dockerfile.dockerignore @@ -0,0 +1,10 @@ +.github +bin +dataserver +doc +docker +stream-server +tinymce-clean-server +Zend +docker-compose.yml + From 0372f2e9dbd6c172f7c2edc4a60221f215e47e99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ALEXANDER=20QUADRATUS=20/=E1=BC=88=CE=BB=CE=AD=CE=BE=CE=B1?= =?UTF-8?q?=CE=BD=CE=B4=CF=81=CE=BF=CF=82=20=CE=9A=CE=BF=CE=B4=CF=81?= =?UTF-8?q?=E1=BE=B6=CF=84=CE=BF=CF=82/?= Date: Sat, 29 Apr 2023 13:15:20 +0700 Subject: [PATCH 09/14] Converted dataserver image to alpine --- bin/init.sh | 12 +- client.Dockerfile | 1 + client.Dockerfile.dockerignore | 3 +- docker/dataserver/config/config.inc.php | 2 +- docker/dataserver/entrypoint.sh | 17 ++- ds.Dockerfile | 182 +++++++++++++++++++----- 6 files changed, 165 insertions(+), 52 deletions(-) diff --git a/bin/init.sh b/bin/init.sh index db9d03bb..94794026 100755 --- a/bin/init.sh +++ b/bin/init.sh @@ -2,8 +2,10 @@ set -eux -sudo docker compose exec app-zotprime-dataserver bash -cux 'cd /var/www/zotero/misc && ./init-mysql.sh' -#sudo docker compose exec app-zotprime-dataserver bash -cux 'cd /var/www/zotero/misc && ./db_update.sh' -sudo docker compose exec app-zotprime-dataserver bash -cux 'aws --endpoint-url "http://minio:9000" s3 mb s3://zotero' -sudo docker compose exec app-zotprime-dataserver bash -cux 'aws --endpoint-url "http://minio:9000" s3 mb s3://zotero-fulltext' -sudo docker compose exec app-zotprime-dataserver bash -cux 'aws --endpoint-url "http://localstack:4575" sns create-topic --name zotero' +sudo docker compose exec app-zotprime-dataserver sh -cux 'cd /var/www/zotero/misc && ./init-mysql.sh' +#sudo docker compose exec app-zotprime-dataserver sh -cux 'cd /var/www/zotero/misc && ./db_update.sh' +#sudo docker compose exec app-zotprime-dataserver sh -cux 'cd /var/www/zotero/misc/db-updates/2021-10-16 && php ./0_addMasterGroupHasData' +#sudo docker compose exec app-zotprime-dataserver sh -cux 'cd /var/www/zotero/misc/db-updates/2021-10-16 && php ./1_removeMasterGroupTimestampAndVersion' +sudo docker compose exec app-zotprime-dataserver sh -cux 'aws --endpoint-url "http://minio:9000" s3 mb s3://zotero' +sudo docker compose exec app-zotprime-dataserver sh -cux 'aws --endpoint-url "http://minio:9000" s3 mb s3://zotero-fulltext' +sudo docker compose exec app-zotprime-dataserver sh -cux 'aws --endpoint-url "http://localstack:4575" sns create-topic --name zotero' diff --git a/client.Dockerfile b/client.Dockerfile index 72d31026..df62cdf3 100644 --- a/client.Dockerfile +++ b/client.Dockerfile @@ -23,6 +23,7 @@ RUN set -eux; \ #cd /usr/src/app/zotero-client && npm run build WORKDIR /usr/src/app/client/zotero-standalone-build +RUN ls -lha RUN set -eux; \ #cd /usr/src/app/zotero-standalone-build && ./fetch_xulrunner.sh -p l diff --git a/client.Dockerfile.dockerignore b/client.Dockerfile.dockerignore index d9a47539..7e19a102 100644 --- a/client.Dockerfile.dockerignore +++ b/client.Dockerfile.dockerignore @@ -21,4 +21,5 @@ stream-server tinymce-clean-server Zend docker-compose.yml - +*.Dockerfile +README.md diff --git a/docker/dataserver/config/config.inc.php b/docker/dataserver/config/config.inc.php index 1032b531..18bde4f8 100644 --- a/docker/dataserver/config/config.inc.php +++ b/docker/dataserver/config/config.inc.php @@ -10,7 +10,7 @@ class Z_CONFIG { public static $TESTING_SITE = false; public static $DEV_SITE = false; - public static $DEBUG_LOG = true; + public static $DEBUG_LOG = false; public static $BASE_URI = 'http://localhost:8080/'; public static $API_BASE_URI = 'http://localhost:8080/'; diff --git a/docker/dataserver/entrypoint.sh b/docker/dataserver/entrypoint.sh index 9ba163b4..d7d12f5d 100755 --- a/docker/dataserver/entrypoint.sh +++ b/docker/dataserver/entrypoint.sh @@ -12,13 +12,15 @@ export APACHE_LOG_DIR=/var/log/apache2 #/etc/init.d/rsyslog start # Start rinetd -/etc/init.d/rinetd start +echo "logfile /dev/stdout" >> /etc/rinetd.conf +rinetd -f -c /etc/rinetd.conf & +#/etc/init.d/rinetd start -a2enmod headers -a2enmod rewrite -a2dissite 000-default -a2ensite zotero -a2enconf gzip +#a2enmod headers +#a2enmod rewrite +#a2dissite 000-default +#a2ensite zotero +#a2enconf gzip # NPM #cd /var/www/zotero/stream-server @@ -57,4 +59,5 @@ cd /var/www/zotero && composer -vv install # Start Apache2 #exec apache2 -e debug -DNO_DETACH -k start -exec apache2 -e debug -DFOREGROUND -k start +exec httpd -e debug -DFOREGROUND -k start +#exec httpd -DFOREGROUND -k start diff --git a/ds.Dockerfile b/ds.Dockerfile index 7f4fbef3..f46532ca 100644 --- a/ds.Dockerfile +++ b/ds.Dockerfile @@ -1,5 +1,45 @@ -# Use the official Docker Hub Ubuntu 18.04 base image -FROM debian:bullseye-slim +#FROM debian:bullseye-slim + +FROM alpine:3 AS builder + + +RUN set -eux; \ + apk update && apk upgrade + +RUN set -eux \ + && apk add --no-cache \ + python3 \ + py3-pip \ + build-base \ + git \ + autoconf \ + automake \ +# util-linux \ + && cd /tmp \ + && git clone --depth=1 "https://github.com/samhocevar/rinetd" \ + && cd rinetd \ + && ./bootstrap \ + && ./configure --prefix=/usr \ + && make -j $(nproc) \ + && strip rinetd \ +# && pip3 install --upgrade pip \ +# && pip3 install -v --no-cache-dir \ +# awscli \ + && rm -rf /var/cache/apk/* + +#RUN aws --version +#RUN whereis aws +#RUN find / -name aws* +#RUN find / -name .aws +#RUN ls -lha /etc/ + + + +FROM alpine:3 + +COPY --from=builder /tmp/rinetd/rinetd /usr/sbin/rinetd +#COPY --from=builder /usr/bin/aws /usr/bin/aws +#FROM php:8.1-alpine # Update the base image #RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -y upgrade && apt-get -y dist-upgrade @@ -11,61 +51,125 @@ FROM debian:bullseye-slim #RUN DEBIAN_FRONTEND=noninteractive apt-get -y install apache2 libapache2-mod-php7.0 sudo rsyslog wget mysql-client curl nodejs #RUN DEBIAN_FRONTEND=noninteractive apt-get -y install php7.0-cli php7.0-xml php7.0-mysql php7.0-pgsql php7.0-json php7.0-curl php7.0-mbstring php7.0-intl php7.0-redis php7.0-dev php-pear composer + RUN set -eux; \ - apt-get update && apt-get install -y --no-install-recommends \ + apk update && apk upgrade && \ + apk add --update --no-cache \ + aws-cli \ apache2 \ - awscli \ + apache2-http2 \ + apache2-utils \ +# ca-certificates \ composer \ curl \ git \ - gnutls-bin \ - libapache2-mod-php \ - libapache2-mod-uwsgi \ -# libc6 \ -# libdigest-hmac-perl \ -# libfile-util-perl \ -# libjson-xs-perl \ -# libplack-perl \ -# libswitch-perl \ + gnutls-utils \ +# libapache2-mod-php \ +# libapache2-mod-uwsgi \ mariadb-client \ -# mariadb-server \ memcached \ net-tools \ -# nodejs \ -# npm \ - php7.4-cli \ - php7.4-curl \ - php7.4-memcached \ - php7.4-mysql \ - php7.4-redis \ - php-http \ - php-igbinary \ + php \ + php-apache2 \ + php-common \ + php-cli \ + php-curl \ + php-dom \ + php-mbstring \ + php-mysqli \ php-pear \ - php-zend-code \ + php-simplexml \ + php-tokenizer \ + php-xml \ + php-xmlwriter \ php-zip \ - rinetd \ + php81-pecl-memcached \ + php81-pecl-redis \ +# php81-pecl-http \ + php81-pecl-igbinary \ + php81-pecl-xdebug \ +# php81-pecl-zend-code \ +# rinetd \ rsyslog \ runit \ unzip \ uwsgi \ - uwsgi-plugin-psgi \ -# vim \ +# uwsgi-plugin-psgi \ wget \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/cache/apk/* +RUN php -v +RUN php --ini + +RUN php -m + +RUN composer show -p + +RUN aws --version + + +RUN set -eux; \ + ls -lha /etc/php81 + + +RUN ls -lha /etc/php81/conf.d +#RUN ls -lha /usr/local/etc/php +RUN sed -i "s/#LoadModule\ rewrite_module/LoadModule\ rewrite_module/" /etc/apache2/httpd.conf \ + && sed -i "s/#LoadModule\ headers_module/LoadModule\ headers_module/" /etc/apache2/httpd.conf \ +# && sed -i "s/#LoadModule\ session_module/LoadModule\ session_module/" /etc/apache2/httpd.conf \ +# && sed -i "s/#LoadModule\ session_cookie_module/LoadModule\ session_cookie_module/" /etc/apache2/httpd.conf \ +# && sed -i "s/#LoadModule\ session_crypto_module/LoadModule\ session_crypto_module/" /etc/apache2/httpd.conf \ + && sed -i "s/#LoadModule\ deflate_module/LoadModule\ deflate_module/" /etc/apache2/httpd.conf \ + && sed -i "s#^DocumentRoot \".*#DocumentRoot \"/var/www/zotero/htdocs\"#g" /etc/apache2/httpd.conf \ + && sed -i "s#/var/www/localhost/htdocs#/var/www/zotero/htdocs#" /etc/apache2/httpd.conf \ + && printf "\n\n\tAllowOverride All\n\n" >> /etc/apache2/httpd.conf + + +RUN grep -R 'LoadModule' /etc/ + +RUN ls -lha /etc/apache2/ + +RUN ls -lha /etc/apache2/conf.d/ + +#RUN ls -lha /usr/local/etc/php/conf.d/ + + +#RUN whereis php + + +# libc6 \ +# libdigest-hmac-perl \ +# libfile-util-perl \ +# libjson-xs-perl \ +# libplack-perl \ +# libswitch-perl +# mariadb-server \ +# nodejs \ +# npm \ +# vim \ +# awscli \ + #RUN apt-get install vim -y #build-essential #RUN apt-get install -y php-pear composer nodejs RUN set -eux; \ - sed -i 's/memory_limit = 128M/memory_limit = 1G/g' /etc/php/7.4/apache2/php.ini; \ - sed -i 's/max_execution_time = 30/max_execution_time = 300/g' /etc/php/7.4/apache2/php.ini; \ - sed -i 's/short_open_tag = Off/short_open_tag = On/g' /etc/php/7.4/apache2/php.ini; \ - sed -i 's/short_open_tag = Off/short_open_tag = On/g' /etc/php/7.4/cli/php.ini; \ - sed -i 's/display_errors = On/display_errors = Off/g' /etc/php/7.4/apache2/php.ini; \ - sed -i 's/error_reporting = E_ALL \& ~E_DEPRECATED \& ~E_STRICT/error_reporting = E_ALL \& ~E_NOTICE \& ~E_STRICT \& ~E_DEPRECATED/g' /etc/php/7.4/apache2/php.ini + sed -i 's/memory_limit = 128M/memory_limit = 1G/g' /etc/php81/php.ini; \ + sed -i 's/max_execution_time = 30/max_execution_time = 300/g' /etc/php81/php.ini; \ + sed -i 's/short_open_tag = Off/short_open_tag = On/g' /etc/php81/php.ini; \ +# sed -i 's/short_open_tag = Off/short_open_tag = On/g' /etc/php/7.4/cli/php.ini; \ + sed -i 's/display_errors = On/display_errors = Off/g' /etc/php81/php.ini; \ + sed -i 's/error_reporting = E_ALL \& ~E_DEPRECATED \& ~E_STRICT/error_reporting = E_ALL \& ~E_NOTICE \& ~E_STRICT \& ~E_DEPRECATED/g' /etc/php81/php.ini +# sed -i 's/error_reporting = E_ALL \& ~E_DEPRECATED \& ~E_STRICT/error_reporting = E_ALL \& ~E_NOTICE/g' /etc/php81/php.ini + +RUN ls -lha /etc/php81/php.ini + +RUN grep -R 'display_errors' /etc/ +RUN grep -R 'log_errors' /etc/ +RUN grep -R 'display_startup_errors' /etc/ +RUN grep -R -A 10 -B 10 'error_reporting' /etc/ # Setup igbinary #RUN apt-get install -y php-igbinary @@ -104,12 +208,12 @@ RUN set -eux; \ #RUN a2enmod rewrite # Enable the new virtualhost -COPY docker/dataserver/zotero.conf /etc/apache2/sites-available/ +#COPY docker/dataserver/zotero.conf /etc/apache2/sites-available/ #RUN a2dissite 000-default #RUN a2ensite zotero # Override gzip configuration -COPY docker/dataserver/gzip.conf /etc/apache2/conf-available/ +#COPY docker/dataserver/gzip.conf /etc/apache2/conf-available/ # @@ -157,7 +261,9 @@ COPY docker/dataserver/gzip.conf /etc/apache2/conf-available/ # AWS local credentials RUN set -eux; \ - mkdir ~/.aws && bash -c 'echo -e "[default]\nregion = us-east-1" > ~/.aws/config' && bash -c 'echo -e "[default]\naws_access_key_id = zotero\naws_secret_access_key = zoterodocker" > ~/.aws/credentials' + mkdir ~/.aws \ + && /bin/sh -c 'echo -e "[default]\nregion = us-east-1" > ~/.aws/config' \ + && /bin/sh -c 'echo -e "[default]\naws_access_key_id = zotero\naws_secret_access_key = zoterodocker" > ~/.aws/credentials' @@ -180,7 +286,7 @@ RUN set -eux; \ #Install uws #WORKDIR /var/ -#ENV APACHE_RUN_USER=${RUN_USER} +#ENV APACHE_RUN_USER=${RUN_USER}true #ENV APACHE_RUN_GROUP=${RUN_GROUP} ENV APACHE_RUN_USER=www-data ENV APACHE_RUN_GROUP=www-data From 5de58033db35c9b8b924cbf4cb8dcf1ed4f7b38e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ALEXANDER=20QUADRATUS=20/=E1=BC=88=CE=BB=CE=AD=CE=BE=CE=B1?= =?UTF-8?q?=CE=BD=CE=B4=CF=81=CE=BF=CF=82=20=CE=9A=CE=BF=CE=B4=CF=81?= =?UTF-8?q?=E1=BE=B6=CF=84=CE=BF=CF=82/?= Date: Sat, 29 Apr 2023 13:29:44 +0700 Subject: [PATCH 10/14] Pulled down update to client submodules --- client/zotero-build | 2 +- client/zotero-client | 2 +- client/zotero-standalone-build | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/zotero-build b/client/zotero-build index f5d24984..5cec38cd 160000 --- a/client/zotero-build +++ b/client/zotero-build @@ -1 +1 @@ -Subproject commit f5d249841b839972625fd8359732b1ba0bb8c829 +Subproject commit 5cec38cd40361d939e32eb0b6e0fd18ac7b78a56 diff --git a/client/zotero-client b/client/zotero-client index be4ad10a..2f0d41c0 160000 --- a/client/zotero-client +++ b/client/zotero-client @@ -1 +1 @@ -Subproject commit be4ad10ae9aa6ed350ea69c4cba3aba40c7b6074 +Subproject commit 2f0d41c0cb9ea47cce03ea51bf8ac718dbe44b15 diff --git a/client/zotero-standalone-build b/client/zotero-standalone-build index 3e5c8434..ea60c6de 160000 --- a/client/zotero-standalone-build +++ b/client/zotero-standalone-build @@ -1 +1 @@ -Subproject commit 3e5c84346ff59db0cdb28493b440fdeda2d8aaf7 +Subproject commit ea60c6deb021f46f5396ea752e8da772b7350a72 From 489f603cffb0529ed30c073eddcf1ced404ec564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ALEXANDER=20QUADRATUS=20/=E1=BC=88=CE=BB=CE=AD=CE=BE=CE=B1?= =?UTF-8?q?=CE=BD=CE=B4=CF=81=CE=BF=CF=82=20=CE=9A=CE=BF=CE=B4=CF=81?= =?UTF-8?q?=E1=BE=B6=CF=84=CE=BF=CF=82/?= Date: Sat, 29 Apr 2023 14:03:27 +0700 Subject: [PATCH 11/14] Fix clinet build throught docker --- client.Dockerfile | 11 ++++++++--- clientbuildtest.Dockerfile | 3 ++- ds.Dockerfile | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/client.Dockerfile b/client.Dockerfile index df62cdf3..917e089f 100644 --- a/client.Dockerfile +++ b/client.Dockerfile @@ -2,7 +2,8 @@ FROM node:16-alpine as intermediate RUN set -eux; \ - apk add --update --no-cache git \ + apk update && apk upgrade && \ + apk add --update --no-cache git bash curl python3 zip perl rsync \ && rm -rf /var/cache/apk/* WORKDIR /usr/src/app @@ -23,10 +24,14 @@ RUN set -eux; \ #cd /usr/src/app/zotero-client && npm run build WORKDIR /usr/src/app/client/zotero-standalone-build -RUN ls -lha + +#RUN set -eux; \ +# apk add --update --no-cache \ + # && rm -rf /var/cache/apk/* + RUN set -eux; \ #cd /usr/src/app/zotero-standalone-build && - ./fetch_xulrunner.sh -p l + /bin/bash -c './fetch_xulrunner.sh -p l' RUN set -eux; \ #cd /usr/src/app/zotero-standalone-build && ./fetch_pdftools diff --git a/clientbuildtest.Dockerfile b/clientbuildtest.Dockerfile index cb13f123..70cf0c28 100644 --- a/clientbuildtest.Dockerfile +++ b/clientbuildtest.Dockerfile @@ -2,7 +2,8 @@ FROM node:16-alpine as intermediate RUN set -eux; \ - apk add --update --no-cache git \ + apk update && apk upgrade && \ + apk add --update --no-cache git bash curl python3 zip perl rsync \ && rm -rf /var/cache/apk/* WORKDIR /usr/src/app diff --git a/ds.Dockerfile b/ds.Dockerfile index f46532ca..a2d23cc4 100644 --- a/ds.Dockerfile +++ b/ds.Dockerfile @@ -57,7 +57,7 @@ RUN set -eux; \ apk add --update --no-cache \ aws-cli \ apache2 \ - apache2-http2 \ +# apache2-http2 \ apache2-utils \ # ca-certificates \ composer \ From f3198f897b013c7bff1886c5bb934b2bdac44a5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ALEXANDER=20QUADRATUS=20/=E1=BC=88=CE=BB=CE=AD=CE=BE=CE=B1?= =?UTF-8?q?=CE=BD=CE=B4=CF=81=CE=BF=CF=82=20=CE=9A=CE=BF=CE=B4=CF=81?= =?UTF-8?q?=E1=BE=B6=CF=84=CE=BF=CF=82/?= Date: Sat, 29 Apr 2023 14:54:58 +0700 Subject: [PATCH 12/14] Fix clinet build throught docker --- .gitignore | 1 + client.Dockerfile | 17 +---------------- client.Dockerfile.dockerignore | 1 + clientbuildtest.Dockerfile | 13 ++----------- clientbuildtest.Dockerfile.dockerignore | 1 + ds.Dockerfile.dockerignore | 1 + minio.Dockerfile.dockerignore | 1 + sts.Dockerfile.dockerignore | 1 + tmcs.Dockerfile.dockerignore | 1 + 9 files changed, 10 insertions(+), 27 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..c795b054 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build \ No newline at end of file diff --git a/client.Dockerfile b/client.Dockerfile index 917e089f..fdedb6c0 100644 --- a/client.Dockerfile +++ b/client.Dockerfile @@ -1,13 +1,10 @@ FROM node:16-alpine as intermediate - RUN set -eux; \ apk update && apk upgrade && \ apk add --update --no-cache git bash curl python3 zip perl rsync \ && rm -rf /var/cache/apk/* - WORKDIR /usr/src/app - COPY . . RUN git submodule update --init --recursive WORKDIR /usr/src/app/client/ @@ -15,30 +12,18 @@ RUN set -eux; \ ./config.sh WORKDIR /usr/src/app/client/zotero-client RUN set -eux; \ - #cd /usr/src/app/zotero-client && npx browserslist@latest --update-db RUN set -eux; \ - #cd /usr/src/app/zotero-client && npm install RUN set -eux; \ - #cd /usr/src/app/zotero-client && npm run build WORKDIR /usr/src/app/client/zotero-standalone-build - -#RUN set -eux; \ -# apk add --update --no-cache \ - # && rm -rf /var/cache/apk/* - RUN set -eux; \ - #cd /usr/src/app/zotero-standalone-build && /bin/bash -c './fetch_xulrunner.sh -p l' RUN set -eux; \ - #cd /usr/src/app/zotero-standalone-build && ./fetch_pdftools RUN set -eux; \ - #cd /usr/src/app/zotero-standalone-build && ./scripts/dir_build -p l - FROM scratch AS export-stage -COPY --from=intermediate /usr/src/app/zotero-standalone-build/staging/* . \ No newline at end of file +COPY --from=intermediate /usr/src/app/client/zotero-standalone-build/staging . \ No newline at end of file diff --git a/client.Dockerfile.dockerignore b/client.Dockerfile.dockerignore index 7e19a102..0696f131 100644 --- a/client.Dockerfile.dockerignore +++ b/client.Dockerfile.dockerignore @@ -14,6 +14,7 @@ clinet/zotero-standalone-build/xulrunner clinet/zotero-standalone-build/pdftools .github bin +build dataserver doc docker diff --git a/clientbuildtest.Dockerfile b/clientbuildtest.Dockerfile index 70cf0c28..306aab22 100644 --- a/clientbuildtest.Dockerfile +++ b/clientbuildtest.Dockerfile @@ -5,7 +5,6 @@ RUN set -eux; \ apk update && apk upgrade && \ apk add --update --no-cache git bash curl python3 zip perl rsync \ && rm -rf /var/cache/apk/* - WORKDIR /usr/src/app RUN mkdir client RUN cd client @@ -14,32 +13,24 @@ RUN git remote add -f origin https://github.com/uniuuu/zotprime RUN echo "client/" >> .git/info/sparse-checkout RUN git pull origin new_dev RUN git submodule update --init --recursive - -#COPY . . WORKDIR /usr/src/app/client/ RUN set -eux; \ ./config.sh WORKDIR /usr/src/app/client/zotero-client RUN set -eux; \ - #cd /usr/src/app/zotero-client && - npx browserslist@latest --update-db + npx browserslist@latest --update-db RUN set -eux; \ - #cd /usr/src/app/zotero-client && npm install RUN set -eux; \ - #cd /usr/src/app/zotero-client && npm run build WORKDIR /usr/src/app/client/zotero-standalone-build RUN set -eux; \ - #cd /usr/src/app/zotero-standalone-build && ./fetch_xulrunner.sh -p l RUN set -eux; \ - #cd /usr/src/app/zotero-standalone-build && ./fetch_pdftools RUN set -eux; \ - #cd /usr/src/app/zotero-standalone-build && ./scripts/dir_build -p l FROM scratch AS export-stage -COPY --from=intermediate /usr/src/app/zotero-standalone-build/staging/* . \ No newline at end of file +COPY --from=intermediate /usr/src/app/client/zotero-standalone-build/staging/* . \ No newline at end of file diff --git a/clientbuildtest.Dockerfile.dockerignore b/clientbuildtest.Dockerfile.dockerignore index 8a91bb00..e7c03907 100644 --- a/clientbuildtest.Dockerfile.dockerignore +++ b/clientbuildtest.Dockerfile.dockerignore @@ -1,5 +1,6 @@ .github bin +build dataserver doc docker diff --git a/ds.Dockerfile.dockerignore b/ds.Dockerfile.dockerignore index 5fe6175f..be78bb65 100644 --- a/ds.Dockerfile.dockerignore +++ b/ds.Dockerfile.dockerignore @@ -1,6 +1,7 @@ .git .github bin +build client dataserver doc diff --git a/minio.Dockerfile.dockerignore b/minio.Dockerfile.dockerignore index dbd6103a..d39ade79 100644 --- a/minio.Dockerfile.dockerignore +++ b/minio.Dockerfile.dockerignore @@ -1,6 +1,7 @@ .git .github bin +build client dataserver doc diff --git a/sts.Dockerfile.dockerignore b/sts.Dockerfile.dockerignore index e3798a86..524dc093 100644 --- a/sts.Dockerfile.dockerignore +++ b/sts.Dockerfile.dockerignore @@ -1,6 +1,7 @@ .git .github bin +build client dataserver doc diff --git a/tmcs.Dockerfile.dockerignore b/tmcs.Dockerfile.dockerignore index e998ca48..e2bca24a 100644 --- a/tmcs.Dockerfile.dockerignore +++ b/tmcs.Dockerfile.dockerignore @@ -1,6 +1,7 @@ .git .github bin +build client dataserver doc From ee9815e0b328936b7769f9807894bb6410b55537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ALEXANDER=20QUADRATUS=20/=E1=BC=88=CE=BB=CE=AD=CE=BE=CE=B1?= =?UTF-8?q?=CE=BD=CE=B4=CF=81=CE=BF=CF=82=20=CE=9A=CE=BF=CE=B4=CF=81?= =?UTF-8?q?=E1=BE=B6=CF=84=CE=BF=CF=82/?= Date: Sat, 29 Apr 2023 15:04:04 +0700 Subject: [PATCH 13/14] Fix clinet build throught docker --- README.md | 13 +++++++++++++ client.Dockerfile | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0e32f2ed..0b63b239 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,19 @@ $ cd .. ## Client installation + +### BETA: Build client via Docker. + +*Run*: +```bash +$ DOCKER_BUILDKIT=1 docker build --progress=plain --file client.Dockerfile --output build . +``` +*Run*: +```bash +$ ./build/staging/Zotero_VERSION/zotero) +``` + + ### Dependencies and source code For [m|l|w]: m=Mac, w=Windows, l=Linux diff --git a/client.Dockerfile b/client.Dockerfile index fdedb6c0..9144a9b5 100644 --- a/client.Dockerfile +++ b/client.Dockerfile @@ -5,7 +5,8 @@ RUN set -eux; \ apk add --update --no-cache git bash curl python3 zip perl rsync \ && rm -rf /var/cache/apk/* WORKDIR /usr/src/app -COPY . . +COPY ./client . +COPY ./.git . RUN git submodule update --init --recursive WORKDIR /usr/src/app/client/ RUN set -eux; \ From 95d8adc7f59dfa3b6abf53cb4452021af606d942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ALEXANDER=20QUADRATUS=20/=E1=BC=88=CE=BB=CE=AD=CE=BE=CE=B1?= =?UTF-8?q?=CE=BD=CE=B4=CF=81=CE=BF=CF=82=20=CE=9A=CE=BF=CE=B4=CF=81?= =?UTF-8?q?=E1=BE=B6=CF=84=CE=BF=CF=82/?= Date: Sat, 29 Apr 2023 15:34:17 +0700 Subject: [PATCH 14/14] Fix client build throught docker --- client.Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client.Dockerfile b/client.Dockerfile index 9144a9b5..bf49ffa3 100644 --- a/client.Dockerfile +++ b/client.Dockerfile @@ -5,9 +5,10 @@ RUN set -eux; \ apk add --update --no-cache git bash curl python3 zip perl rsync \ && rm -rf /var/cache/apk/* WORKDIR /usr/src/app -COPY ./client . -COPY ./.git . -RUN git submodule update --init --recursive +COPY . . +RUN git submodule update --init --recursive client/zotero-build +RUN git submodule update --init --recursive client/zotero-standalone-build +RUN git submodule update --init --recursive client/zotero-client WORKDIR /usr/src/app/client/ RUN set -eux; \ ./config.sh