Skip to content

Commit

Permalink
Install curl in the Dockerfile for healthchecks (#209)
Browse files Browse the repository at this point in the history
### What

If we have `curl`, we can do a very basic healthcheck like `curl
localhost:8100/health`. Note that it must be installed _after_ the
second `FROM`.

### How

<!-- How is it trying to accomplish it (what are the implementation
steps)? -->

Co-authored-by: Tom Harding <[email protected]>
  • Loading branch information
i-am-tom and Tom Harding authored Aug 29, 2023
1 parent e60730b commit ddc8b14
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target
3 changes: 3 additions & 0 deletions ConfigServer.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@ RUN cargo build --release --all-targets
## Copy the binaries and serve the configuration server
FROM debian:buster-slim as ndc-postgres
ENV PORT=9100

## Install curl for the health check
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --assume-yes curl
COPY --from=build /app/target/release/ndc-postgres ./ndc-postgres
CMD ["sh", "-c", "./ndc-postgres configuration serve"]

0 comments on commit ddc8b14

Please sign in to comment.