From 040a5256cf7d0dfc84632d201df4384ac2f10ba1 Mon Sep 17 00:00:00 2001 From: jpsl Date: Wed, 1 Jun 2022 12:55:29 +0100 Subject: [PATCH] #74 - something is wrong with startup-script. Trying again. --- apihub-root/index.html | 1 + docker/api/Dockerfile | 6 +++--- docker/api/docker-compose.yml | 4 ++-- docker/api/startup-script.sh | 3 ++- docker/api/traceability/Dockerfile | 4 +--- docker/api/traceability/startup-script-bc.sh | 3 ++- docker/api/traceability/startup-script.sh | 3 ++- 7 files changed, 13 insertions(+), 11 deletions(-) diff --git a/apihub-root/index.html b/apihub-root/index.html index cb2f9ec0..956b59b7 100644 --- a/apihub-root/index.html +++ b/apihub-root/index.html @@ -429,6 +429,7 @@

Participant Workspace

v0.9.6? Release Notes 2022-MM-DD (Pending changes for the next release)

diff --git a/docker/api/Dockerfile b/docker/api/Dockerfile index bcc0f307..511404da 100644 --- a/docker/api/Dockerfile +++ b/docker/api/Dockerfile @@ -1,5 +1,8 @@ +# # Docker image build for Finished Goods Traceability (FGT) # +# docker build --build-arg GIT_BRANCH=v0.9.6 -t fgt:v0.9.6 --rm=false --pull --network host -f=Dockerfile . +# FROM node:14.17.4-alpine # The tag, branch or commit hash to clone. @@ -20,9 +23,6 @@ WORKDIR /fgt-workspace RUN git clone -b ${GIT_BRANCH} --single-branch --depth 1 https://github.com/PharmaLedger-IMI/fgt-workspace.git . && \ npm install --unsafe-perm -# copy bdns+domain configuration files from local context -COPY config/ apihub-root/external-volume/config/ - # Remove all Git related files and directories - see https://gist.github.com/facelordgists/80e868ff5e315878ecd6 RUN find . \( -name ".git" -o -name ".gitignore" -o -name ".gitmodules" -o -name ".gitattributes" \) -exec rm -rf -- {} + diff --git a/docker/api/docker-compose.yml b/docker/api/docker-compose.yml index 66a503f8..c1a26656 100644 --- a/docker/api/docker-compose.yml +++ b/docker/api/docker-compose.yml @@ -10,7 +10,7 @@ x-participant-def: timeout: 3s retries: 100 start_period: 40s - command: ["/bin/bash", "-c", "cd /fgt-workspace ; npm run server & ( sleep 5s ; npm run build-all ; cd fgt-api ; npm run boot-api )"] + command: ["/bin/sh", "-c", "/fgt-workspace/docker/api/startup-script.sh"] # the command above is not for the tracebility apihub, so it must be overridden on fgt-workspace. x-mah-def: &mah-def @@ -123,7 +123,7 @@ services: timeout: 3s retries: 100 start_period: 20s - command: ["/bin/sh", "-c", "/fgt-workspace/docker/api/startup-script-bc.sh"] + command: ["/bin/sh", "-c", "/fgt-workspace/docker/api/traceability/startup-script.sh"] mah-roche: << : *mah-def diff --git a/docker/api/startup-script.sh b/docker/api/startup-script.sh index 7195c7dc..1c192fd3 100755 --- a/docker/api/startup-script.sh +++ b/docker/api/startup-script.sh @@ -1,5 +1,6 @@ #!/bin/sh # use /bin/sh to be compatible with Alpine / Busybox +# This script expects cwd to be /fgt-workspace rm -rf apihub-root/external-volume/config cp -r docker/api/config apihub-root/external-volume/config -cd /fgt-workspace ; npm run server & ( sleep 5s ; npm run build-all ; cd fgt-api ; npm run boot-api ) \ No newline at end of file +npm run server & ( sleep 5s ; npm run build-all ; cd fgt-api ; npm run boot-api ) \ No newline at end of file diff --git a/docker/api/traceability/Dockerfile b/docker/api/traceability/Dockerfile index 47322cc8..d71db712 100644 --- a/docker/api/traceability/Dockerfile +++ b/docker/api/traceability/Dockerfile @@ -1,3 +1,4 @@ +# # Docker image build for Finished Goods Traceability (FGT) # FROM node:14.17.4-alpine @@ -20,9 +21,6 @@ WORKDIR /fgt-workspace RUN git clone -b ${GIT_BRANCH} --single-branch --depth 1 https://github.com/PharmaLedger-IMI/fgt-workspace.git . && \ npm install --unsafe-perm -# copy bdns+domain configuration files from local context -COPY config/ apihub-root/external-volume/config/ - # Remove all Git related files and directories - see https://gist.github.com/facelordgists/80e868ff5e315878ecd6 RUN find . \( -name ".git" -o -name ".gitignore" -o -name ".gitmodules" -o -name ".gitattributes" \) -exec rm -rf -- {} + diff --git a/docker/api/traceability/startup-script-bc.sh b/docker/api/traceability/startup-script-bc.sh index abd976ab..9a88efca 100755 --- a/docker/api/traceability/startup-script-bc.sh +++ b/docker/api/traceability/startup-script-bc.sh @@ -1,5 +1,6 @@ #!/bin/sh # use /bin/sh to be compatible with Alpine / Busybox +# This script expects cwd to be /fgt-workspace rm -rf apihub-root/external-volume/config cp -r docker/api/config apihub-root/external-volume/config -cd /fgt-workspace ; npm run switch-to-test-chain ; npm run server & ( sleep 5s ; npm run build-all ; tail -f /dev/null ) \ No newline at end of file +npm run switch-to-test-chain ; npm run server & ( sleep 5s ; npm run build-all ; tail -f /dev/null ) \ No newline at end of file diff --git a/docker/api/traceability/startup-script.sh b/docker/api/traceability/startup-script.sh index 60598487..4b60f14a 100755 --- a/docker/api/traceability/startup-script.sh +++ b/docker/api/traceability/startup-script.sh @@ -1,5 +1,6 @@ #!/bin/sh # use /bin/sh to be compatible with Alpine / Busybox +# This script expects cwd to be /fgt-workspace rm -rf apihub-root/external-volume/config cp -r docker/api/config apihub-root/external-volume/config -cd /fgt-workspace ; npm run switch-to-simul-chain ; npm run server & ( sleep 5s ; npm run build-all ; tail -f /dev/null ) \ No newline at end of file +npm run switch-to-simul-chain ; npm run server & ( sleep 5s ; npm run build-all ; tail -f /dev/null ) \ No newline at end of file