From 212bdefa3b0b57285f9629f597f36f580ba55702 Mon Sep 17 00:00:00 2001 From: gianluca-mascolo Date: Sat, 3 Oct 2020 17:49:14 +0200 Subject: [PATCH] use squidclient for unit test --- docker-compose.test.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 7b48686..af6539b 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -1,11 +1,20 @@ version: '2' services: proxy: - build: . + image: squidproxy + build: + context: . + dockerfile: Dockerfile + healthcheck: + test: ["CMD", "sh", "-exc", "squidclient -T 3 mgr:info 2> /dev/null | grep -qF '200 OK'"] + interval: 5s + timeout: 3s + retries: 5 + start_period: 1s sut: - image: alpine:3.10.1 + image: squidproxy links: - proxy depends_on: - proxy - command: sh -exc "apk add --update curl && sleep 5 && exec curl --proxy http://proxy:3128 -I http://google.com/" + command: sh -exc "sleep 10 && squidclient -h proxy -T 3 'https://postman-echo.com/get?squidtest=ok' 2> /dev/null | grep -qF '200 OK'"