Skip to content

Commit

Permalink
feat: add healthchecks on dockercompose
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag committed Aug 3, 2022
1 parent 56ef055 commit e9e6841
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RUN --mount=type=cache,id=gomod,target=/go/pkg/mod \
-X $(cat go.mod |head -1|cut -d \ -f2)/cmd.Commit=${APP_SHA}" ./

FROM ubuntu:jammy
RUN apt update && apt install -y ca-certificates && rm -rf /var/lib/apt/lists/*
RUN apt update && apt install -y ca-certificates curl && rm -rf /var/lib/apt/lists/*
COPY --from=builder /src/main /main
EXPOSE 3068
ENTRYPOINT ["/main"]
Expand Down
6 changes: 3 additions & 3 deletions cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ var serveCmd = &cobra.Command{
oidc.GrantTypeRefreshToken,
oidc.GrantTypeClientCredentials,
},
"post_logout_redirect_uri": `["http://localhost:3000/"]`,
"access_token_type": op.AccessTokenTypeJWT,
"secrets": fmt.Sprintf(`[{"hash": "%s"}]`, secret.Hash),
"post_logout_redirect_uris": `["http://localhost:3000/"]`,
"access_token_type": op.AccessTokenTypeJWT,
"secrets": fmt.Sprintf(`[{"hash": "%s"}]`, secret.Hash),
}),
}).
Create(client).Error
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ services:
build:
context: .
dockerfile: reflex.Dockerfile
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/_healthcheck"]
interval: 1s
entrypoint:
- reflex
- -r
Expand Down
1 change: 1 addition & 0 deletions reflex.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
FROM golang:1.18-alpine
RUN go install github.com/cespare/reflex@latest
RUN apk update && apk add curl

0 comments on commit e9e6841

Please sign in to comment.