mirror of
				https://github.com/b4tman/docker-squid.git
				synced 2025-11-04 02:58:26 +00:00 
			
		
		
		
	use squidclient for unit test
This commit is contained in:
		@@ -1,11 +1,20 @@
 | 
				
			|||||||
version: '2'
 | 
					version: '2'
 | 
				
			||||||
services:
 | 
					services:
 | 
				
			||||||
  proxy:
 | 
					  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:
 | 
					  sut:
 | 
				
			||||||
    image: alpine:3.10.1
 | 
					    image: squidproxy
 | 
				
			||||||
    links: 
 | 
					    links: 
 | 
				
			||||||
      - proxy
 | 
					      - proxy
 | 
				
			||||||
    depends_on:
 | 
					    depends_on:
 | 
				
			||||||
      - proxy
 | 
					      - 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'"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user