Compare commits
6 Commits
v0.1.1
...
da34ef84e3
| Author | SHA1 | Date | |
|---|---|---|---|
| da34ef84e3 | |||
| fd7ffee647 | |||
| 13e943e32b | |||
| 1465691595 | |||
| 0f92c0443c | |||
| 1112e0c1f2 |
11
Dockerfile
11
Dockerfile
@@ -1,11 +1,8 @@
|
|||||||
FROM ubuntu:latest
|
FROM alpine:latest
|
||||||
|
|
||||||
# 更新並安裝必要的工具後清理暫存檔案以減小映像檔大小
|
|
||||||
RUN apt update \
|
|
||||||
&& apt install -y curl \
|
|
||||||
&& apt clean \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
|
# 安裝必要的工具
|
||||||
|
RUN apk add --no-cache --no-check-certificate bash curl
|
||||||
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|||||||
@@ -26,9 +26,6 @@ while true; do
|
|||||||
STATUS_CODE=$(curl -s --max-time 60 -o /dev/null -w "%{http_code}" "$CHECK_URL")
|
STATUS_CODE=$(curl -s --max-time 60 -o /dev/null -w "%{http_code}" "$CHECK_URL")
|
||||||
|
|
||||||
echo "$STATUS_CODE" && [ "$STATUS_CODE" != "000" ] && break
|
echo "$STATUS_CODE" && [ "$STATUS_CODE" != "000" ] && break
|
||||||
|
|
||||||
# 如果狀態碼為 "000",表示連線失敗,等待 60 秒後重試
|
|
||||||
sleep 60
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# 將狀態碼輸出到環境變數
|
# 將狀態碼輸出到環境變數
|
||||||
|
|||||||
Reference in New Issue
Block a user