Skip to content

Commit

Permalink
feat(docker): add healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
Jibbajabbafic committed Oct 27, 2023
1 parent 30a00d3 commit 122a821
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,12 @@ RUN cargo build --release
# We do not need the Rust toolchain to run the binary!
FROM debian:bullseye-slim AS runtime
WORKDIR /app

# Install curl for healthcheck
RUN apt update && apt install -y curl

HEALTHCHECK --interval=1m --timeout=10s --retries=3 --start-period=1m \
CMD curl --fail localhost:3000/api/list/servers || exit 1

COPY --from=builder /app/target/release/game_server_list /usr/local/bin
ENTRYPOINT ["/usr/local/bin/game_server_list"]

0 comments on commit 122a821

Please sign in to comment.