Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 22 additions & 9 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
# Build stage
FROM rust:alpine AS builder
FROM rust:slim-trixie AS builder

# Install musl-dev and build tools for static linking
RUN apk add --no-cache musl-dev build-base lld cmake
# Install build tools plus the downloader dependencies used by the lbug crate.
RUN apt-get update && apt-get install -y --no-install-recommends \
bash \
build-essential \
ca-certificates \
curl \
lld \
&& rm -rf /var/lib/apt/lists/*

# Set the working directory inside the container
WORKDIR /app

# Copy the source code into the container
COPY . .

# Build the project in release mode for the specific binaries
RUN cargo build --release --bin bolt4rs-server --bin test_client
# Build against the self-contained static liblbug archive matching the Cargo dependency.
RUN set -eux; \
LBUG_VERSION="$(sed -n 's/^lbug = .*version = "[>=<~^ ]*\([0-9][^", ]*\)".*/\1/p' server/Cargo.toml)"; \
test -n "$LBUG_VERSION"; \
export LBUG_VERSION; \
cargo build --release --bin bolt4rs-server --bin test_client

# Runtime stage
FROM alpine:latest
FROM debian:trixie-slim

# Install ca-certificates if needed (for HTTPS, but probably not necessary here)
RUN apk --no-cache add ca-certificates
# Install runtime dependencies for the C++ runtime linked by the server binary.
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
libstdc++6 \
&& rm -rf /var/lib/apt/lists/*

# Set the working directory inside the container
WORKDIR /app
Expand All @@ -37,4 +50,4 @@ ENV RUST_LOG=info
RUN mkdir -p /app/data /app/logs

# Command to run the binary and log to file
CMD ["sh", "-c", "cd /app && ./bolt4rs-server > /app/logs/server.log 2>&1"]
CMD ["sh", "-c", "cd /app && ./bolt4rs-server > /app/logs/server.log 2>&1"]
2 changes: 1 addition & 1 deletion server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ env_logger = "0.10"
bolt4rs = { path = "../lib", features = ["unstable-bolt-protocol-impl-v2", "unstable-serde-packstream-format"] }
anyhow = "1.0"
clap = { version = ">=4.4, <=4.5.56", features = ["derive"] }
lbug = { version = "^0.16.0", features = ["arrow"] }
lbug = { version = ">=0.17.1", features = ["arrow"] }
arrow-array = { version = "55.0.0", default-features = false }
arrow = { version = "55.0.0", default-features = false }
arrow-schema = { version = "55.0.0", default-features = false }
Expand Down
Loading