dockerfile testing - http check close

pull/41/head^2
Hunter Long 2018-08-14 23:28:29 -07:00
parent 2ba1a7f359
commit 8af93329e1
4 changed files with 5 additions and 6 deletions

View File

@ -1,6 +1,6 @@
FROM alpine:latest
ENV VERSION=v0.37
ENV VERSION=v0.4
RUN apk --no-cache add libstdc++ ca-certificates
RUN wget -q https://github.com/hunterlong/statup/releases/download/$VERSION/statup-linux-alpine.tar.gz && \

View File

@ -1,4 +1,4 @@
FROM golang:1.10.3-alpine
FROM golang:1.10.3
RUN apk update && apk add git g++ libstdc++ ca-certificates
@ -21,7 +21,5 @@ ENV CMD_FILE=/usr/bin/cmd
RUN printf "#!/usr/bin/env sh\n\$1\n" > $CMD_FILE && \
chmod +x $CMD_FILE
WORKDIR /app
VOLUME /app
EXPOSE 8080
ENTRYPOINT statup

View File

@ -1,4 +1,4 @@
VERSION=0.39
VERSION=0.4
GOPATH:=$(GOPATH)
GOCMD=go
GOBUILD=$(GOCMD) build
@ -65,7 +65,7 @@ docker-dev-run: docker-dev
$(DOCKER) run -t -p 8080:8080 hunterlong/statup:dev
docker-test: docker-dev
$(DOCKER_COMP) -f servers/docker-compose-test.yml up
$(DOCKER) run -t --entrypoint="go test -v ./..." hunterlong/statup:dev
databases:
$(DOCKER) run --name statup_postgres -p 5432:5432 -e POSTGRES_PASSWORD=password123 -e POSTGRES_USER=root -e POSTGRES_DB=root -d postgres

View File

@ -109,6 +109,7 @@ func ServiceHTTPCheck(s *types.Service) *types.Service {
RecordFailure(s, fmt.Sprintf("HTTP Error %v", err))
return s
}
response.Header.Set("Connection", "close")
response.Header.Set("User-Agent", "StatupMonitor")
t2 := time.Now()
s.Latency = t2.Sub(t1).Seconds()