Skip to content

Commit

Permalink
Merge pull request #47 from omnia-network/fix/docker-healthcheck
Browse files Browse the repository at this point in the history
fix: docker healthcheck
  • Loading branch information
ilbertt authored Feb 1, 2025
2 parents 21ad802 + 1d1f1a9 commit 348560a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,23 @@ RUN cargo build --release
### run the IC WS Gateway (we don't need the rust toolchain to run the binary)
FROM debian:bullseye-slim AS runtime
WORKDIR /ic-ws-gateway
# install some utils
RUN apt update
RUN apt install -y curl
# copy the compiled binary
COPY --from=builder /ic-ws-gateway/target/release/ic_websocket_gateway .

EXPOSE 8080
EXPOSE 9000

HEALTHCHECK --timeout=30s --interval=30s --retries=5 \
CMD curl -s -i -N -X GET --head \
-H "Connection: Upgrade" \
-H "Upgrade: websocket" \
-H "Sec-WebSocket-Version: 13" \
-H "Sec-WebSocket-Key: jWPXCaHslL1epUzz0k29Qw==" \
http://127.0.0.1:8080 \
| grep -q "HTTP/1.1 101 Switching Protocols" && exit 0 || exit 1

# run the Gateway
ENTRYPOINT ["/ic-ws-gateway/ic_websocket_gateway"]
4 changes: 2 additions & 2 deletions docker-compose-prod.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
services:
ic_websocket_gateway:
ports:
- ${LISTEN_PORT}:443
- ${LISTEN_PORT}:8080
command:
[
"--gateway-address",
"0.0.0.0:443",
"0.0.0.0:8080",
"--ic-network-url",
"${IC_URL}",
"--polling-interval",
Expand Down
2 changes: 1 addition & 1 deletion src/ic-websocket-gateway/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ic_websocket_gateway"
version = "1.4.4"
version = "1.4.5"
edition.workspace = true
rust-version.workspace = true
repository.workspace = true
Expand Down

0 comments on commit 348560a

Please sign in to comment.