Skip to content

Commit

Permalink
Merge pull request #12 from MiSArch/fixed-healthcheck
Browse files Browse the repository at this point in the history
Internal healthcheck endpoint + added wget dependency
  • Loading branch information
legendofa authored May 1, 2024
2 parents 1092812 + a52fc1c commit be21dbc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion base-dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /misarch-shoppingcart/recipe.json recipe.json

RUN apt update && apt install -y protobuf-compiler && rm -rf /var/lib/apt/lists/*
RUN apt update && apt install -y wget && rm -rf /var/lib/apt/lists/*

# Build dependencies - this is the caching Docker layer!
RUN cargo chef cook --release --recipe-path recipe.json
Expand All @@ -22,6 +22,8 @@ RUN cargo build --release --bin misarch-shoppingcart
# We do not need the Rust toolchain to run the binary!
FROM debian:bookworm-slim AS runtime

RUN apt update && apt install -y wget && rm -rf /var/lib/apt/lists/*

WORKDIR /misarch-shoppingcart
COPY --from=builder /misarch-shoppingcart/target/release/misarch-shoppingcart /usr/local/bin
ENTRYPOINT ["/usr/local/bin/misarch-shoppingcart"]
2 changes: 2 additions & 0 deletions dev-dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM rust:1.75-slim-bookworm

RUN apt update && apt install -y wget && rm -rf /var/lib/apt/lists/*

WORKDIR /usr/src/misarch-shoppingcart

COPY . .
Expand Down
2 changes: 2 additions & 0 deletions devcontainer-dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
FROM rust:1.75-slim-bookworm

RUN apt update && apt install -y wget && rm -rf /var/lib/apt/lists/*

WORKDIR /usr/src/misarch-shoppingcart
2 changes: 1 addition & 1 deletion docker-compose-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
context: .
dockerfile: base-dockerfile
healthcheck:
test: wget http://localhost:8080/graphiql || exit 1
test: wget -qO - http://localhost:8080/health || exit 1
interval: 1s
timeout: 10s
retries: 20
Expand Down

0 comments on commit be21dbc

Please sign in to comment.