Dockerfile.strfry raw

   1  # strfry Dockerfile for negentropy interop testing
   2  # Uses Ubuntu for easier dependency management
   3  
   4  FROM ubuntu:22.04 AS builder
   5  
   6  ENV DEBIAN_FRONTEND=noninteractive
   7  
   8  # Install build dependencies
   9  RUN apt-get update && apt-get install -y \
  10      git \
  11      build-essential \
  12      liblmdb-dev \
  13      libsecp256k1-dev \
  14      libflatbuffers-dev \
  15      libzstd-dev \
  16      libssl-dev \
  17      zlib1g-dev \
  18      pkg-config \
  19      libtool \
  20      autoconf \
  21      automake \
  22      curl \
  23      && rm -rf /var/lib/apt/lists/*
  24  
  25  WORKDIR /build
  26  
  27  # Clone strfry
  28  RUN git clone https://github.com/hoytech/strfry.git . && \
  29      git submodule update --init
  30  
  31  # Build strfry
  32  RUN make setup-golpe && \
  33      make -j$(nproc)
  34  
  35  # Runtime image
  36  FROM ubuntu:22.04
  37  
  38  RUN apt-get update && apt-get install -y \
  39      liblmdb0 \
  40      libsecp256k1-0 \
  41      libflatbuffers1 \
  42      libzstd1 \
  43      libssl3 \
  44      curl \
  45      jq \
  46      && rm -rf /var/lib/apt/lists/*
  47  
  48  # Install websocat binary (not available in apt)
  49  RUN curl -L -o /usr/local/bin/websocat https://github.com/vi/websocat/releases/download/v1.13.0/websocat.x86_64-unknown-linux-musl && \
  50      chmod +x /usr/local/bin/websocat
  51  
  52  WORKDIR /app
  53  COPY --from=builder /build/strfry /app/
  54  RUN mkdir -p /data/strfry-db
  55  
  56  # Copy config
  57  COPY strfry.conf /etc/strfry.conf
  58  
  59  EXPOSE 7777
  60  
  61  HEALTHCHECK --interval=5s --timeout=5s --start-period=10s --retries=3 \
  62    CMD curl -f http://localhost:7777 || exit 1
  63  
  64  # Run strfry relay
  65  CMD ["/app/strfry", "--config=/etc/strfry.conf", "relay"]
  66