Skip to content

Commit

Permalink
#74 - something is wrong with startup-script. Trying again.
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoluis-pdm committed Jun 1, 2022
1 parent 95c81eb commit 040a525
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions apihub-root/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ <h3><a id="participant-name">Participant</a> Workspace</h3>

<h2>v0.9.6? Release Notes 2022-MM-DD (Pending changes for the next release)</h2>
<ul>
<li>Experimental dockerhub image.</li>
<li>Shipment creation error messages on the DSU layer are reported back to the REST /shipment/create caller.</li>
</ul>

Expand Down
6 changes: 3 additions & 3 deletions docker/api/Dockerfile
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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 -- {} +

Expand Down
4 changes: 2 additions & 2 deletions docker/api/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion docker/api/startup-script.sh
Original file line number Diff line number Diff line change
@@ -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 )
npm run server & ( sleep 5s ; npm run build-all ; cd fgt-api ; npm run boot-api )
4 changes: 1 addition & 3 deletions docker/api/traceability/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#
# Docker image build for Finished Goods Traceability (FGT)
#
FROM node:14.17.4-alpine
Expand All @@ -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 -- {} +

Expand Down
3 changes: 2 additions & 1 deletion docker/api/traceability/startup-script-bc.sh
Original file line number Diff line number Diff line change
@@ -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 )
npm run switch-to-test-chain ; npm run server & ( sleep 5s ; npm run build-all ; tail -f /dev/null )
3 changes: 2 additions & 1 deletion docker/api/traceability/startup-script.sh
Original file line number Diff line number Diff line change
@@ -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 )
npm run switch-to-simul-chain ; npm run server & ( sleep 5s ; npm run build-all ; tail -f /dev/null )

0 comments on commit 040a525

Please sign in to comment.