diff --git a/.dockerignore b/.dockerignore index fa0072ab..05d6ce42 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,8 @@ .git -docs -contrib Dockerfile Makefile +bramble +contrib +docs +examples +testsrv diff --git a/Dockerfile b/Dockerfile index f8341387..5c6d98da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,8 @@ -FROM golang:1.17 AS builder +FROM golang:1.17-alpine3.15 AS builder ARG VERSION=SNAPSHOT ENV GO111MODULE=on +ENV CGO_ENABLED=0 WORKDIR /workspace @@ -9,9 +10,7 @@ COPY go.mod go.sum /workspace/ RUN go mod download -COPY *.go /workspace/ -COPY cmd /workspace/cmd -COPY plugins /workspace/plugins +COPY . /workspace/ RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-X 'github.com/movio/bramble.Version=$VERSION'" -o bramble ./cmd/bramble @@ -23,4 +22,4 @@ EXPOSE 8082 EXPOSE 8083 EXPOSE 8084 -CMD [ "/bramble", "-conf", "/config.json" ] +CMD [ "/bramble", "-config", "/config.json" ] diff --git a/docker-compose.yaml b/docker-compose.yaml index 35cefa1e..59ffafeb 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -4,7 +4,7 @@ services: build: context: examples/gqlgen-service healthcheck: - test: curl --fail http://localhost:8080/health || exit 1 + test: wget -qO - http://localhost:8080/health interval: 5s timeout: 1s retries: 5 @@ -12,7 +12,7 @@ services: - 8080 gophers-server: healthcheck: - test: curl --fail http://localhost:8080/health || exit 1 + test: wget -qO - http://localhost:8080/health interval: 5s timeout: 1s retries: 5 @@ -22,7 +22,7 @@ services: - 8080 nodejs-server: healthcheck: - test: curl --fail http://localhost:8080/health || exit 1 + test: wget -qO - http://localhost:8080/health interval: 5s timeout: 1s retries: 5 diff --git a/examples/gqlgen-service/Dockerfile b/examples/gqlgen-service/Dockerfile index b247a91b..50f31e5a 100644 --- a/examples/gqlgen-service/Dockerfile +++ b/examples/gqlgen-service/Dockerfile @@ -1,4 +1,6 @@ -FROM golang +FROM golang:1.17-alpine3.15 + +ENV CGO_ENABLED=0 WORKDIR /go/src/app diff --git a/examples/graph-gophers-service/Dockerfile b/examples/graph-gophers-service/Dockerfile index b7fa7e0a..dbf7b7cb 100644 --- a/examples/graph-gophers-service/Dockerfile +++ b/examples/graph-gophers-service/Dockerfile @@ -1,4 +1,6 @@ -FROM golang +FROM golang:1.17-alpine3.15 + +ENV CGO_ENABLED=0 WORKDIR /go/src/app diff --git a/examples/nodejs-service/Dockerfile b/examples/nodejs-service/Dockerfile index adf27e55..260b1029 100644 --- a/examples/nodejs-service/Dockerfile +++ b/examples/nodejs-service/Dockerfile @@ -1,4 +1,4 @@ -FROM node +FROM node:18-alpine3.15 COPY . .