Skip to content

Commit

Permalink
chore:metadata in dockerfile (#217)
Browse files Browse the repository at this point in the history
* added additional metadata to our dockerfile

* simplified the healthcheck
  • Loading branch information
CommanderStorm authored Sep 12, 2023
1 parent fa6863d commit 9acfa52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,10 @@ COPY --from=builder /etc/passwd /etc/passwd
# Use an unprivileged user
USER appuser

# metadata
EXPOSE 50051
HEALTHCHECK --interval=5m --timeout=3s \
CMD wget --no-verbose --tries=1 --spider http://localhost:50051/health && exit 0 || exit 1

# Run the main binary
CMD ["/backend"]
3 changes: 1 addition & 2 deletions server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ func main() {
})

mux.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
_ = json.NewEncoder(w).Encode(map[string]string{"status": "healthy"})
_, _ = w.Write([]byte("healthy"))
})

static, _ := fs.Sub(swagfs, "swagger")
Expand Down

0 comments on commit 9acfa52

Please sign in to comment.