This commit is contained in:
@@ -46,10 +46,10 @@ jobs:
|
|||||||
# It checks the status every 5 seconds. If the container doesn't become healthy
|
# It checks the status every 5 seconds. If the container doesn't become healthy
|
||||||
# within the timeout, the script will exit with an error, failing the workflow.
|
# within the timeout, the script will exit with an error, failing the workflow.
|
||||||
end_time=$(( $(date +%s) + 300 )) # 5 minute timeout
|
end_time=$(( $(date +%s) + 300 )) # 5 minute timeout
|
||||||
while [ "$(docker inspect -f {{.State.Health.Status}} tor 2>/dev/null || echo 'unhealthy')" != "healthy" ]; do
|
while [ "$(docker inspect -f {{.State.Health.Status}} tor-proxy 2>/dev/null || echo 'unhealthy')" != "healthy" ]; do
|
||||||
if [ $(date +%s) -gt $end_time ]; then
|
if [ $(date +%s) -gt $end_time ]; then
|
||||||
echo "Timeout: Container did not become healthy within 5 minutes."
|
echo "Timeout: Container did not become healthy within 5 minutes."
|
||||||
docker logs tor # Print logs for debugging
|
docker logs tor-proxy # Print logs for debugging
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|||||||
2
Dockerfile
Normal file
2
Dockerfile
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
FROM osminogin/tor-simple
|
||||||
|
RUN apk add --no-cache netcat-openbsd
|
||||||
@@ -7,3 +7,9 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "9050:9050"
|
- "9050:9050"
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "nc", "-z", "localhost", "9050"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
start_period: 15s
|
||||||
|
|||||||
Reference in New Issue
Block a user