diff --git a/.gitea/workflows/build-and-deployment.yaml b/.gitea/workflows/build-and-deployment.yaml index 679542d..ea68bcb 100644 --- a/.gitea/workflows/build-and-deployment.yaml +++ b/.gitea/workflows/build-and-deployment.yaml @@ -46,10 +46,10 @@ jobs: # 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. 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 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 fi sleep 5 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c24038c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,2 @@ +FROM osminogin/tor-simple +RUN apk add --no-cache netcat-openbsd diff --git a/compose.yaml b/compose.yaml index 753dd06..a3cc593 100644 --- a/compose.yaml +++ b/compose.yaml @@ -7,3 +7,9 @@ services: restart: always ports: - "9050:9050" + healthcheck: + test: ["CMD", "nc", "-z", "localhost", "9050"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 15s