Skip to content

Commit 77e233c

Browse files
committed
#141 Add retry logic for TKSBrokerAPI installation in Dockerfile
1 parent 9c2354d commit 77e233c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

deploy/Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,15 @@ RUN if [ -z "$TKS_BUILD_VERSION" ]; then \
1919
pip install --no-cache-dir --pre tksbrokerapi; \
2020
else \
2121
echo "📦 Installing TKSBrokerAPI==$TKS_BUILD_VERSION from PyPI..." && \
22-
pip install --no-cache-dir tksbrokerapi==$TKS_BUILD_VERSION; \
22+
attempt=0; \
23+
until pip install --no-cache-dir tksbrokerapi==$TKS_BUILD_VERSION || [ $attempt -ge 5 ]; do \
24+
attempt=$((attempt+1)); \
25+
echo "⏳ Attempt $attempt/5: Waiting 5s for PyPI..." && sleep 5; \
26+
done; \
27+
if [ $attempt -ge 5 ]; then \
28+
echo "❌ Failed to install TKSBrokerAPI==$TKS_BUILD_VERSION after 5 attempts"; \
29+
exit 1; \
30+
fi; \
2331
fi
2432

2533
# Clean image

0 commit comments

Comments
 (0)