atproto relay implementation in zig zlay.waow.tech

fix: multi-stage Dockerfile for native x86_64 compilation

cross-compiling RocksDB C++ from ARM64 produces illegal instructions.
build inside x86_64 container instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+13 -2
+13 -2
Dockerfile
··· 1 - FROM alpine:3.21 2 RUN apk add --no-cache ca-certificates 3 - COPY zig-out/bin/zlay /usr/local/bin/zlay 4 RUN mkdir -p /data/events 5 ENV RELAY_DATA_DIR=/data/events 6 EXPOSE 3000 3001
··· 1 + # multi-stage build: compile natively inside x86_64 linux container 2 + # (cross-compiling C++ from ARM64 produces illegal instructions in RocksDB) 3 + FROM --platform=linux/amd64 alpine:3.21 AS builder 4 + RUN apk add --no-cache curl tar xz 5 + RUN curl -L https://ziglang.org/download/0.15.2/zig-linux-x86_64-0.15.2.tar.xz \ 6 + | tar xJ -C /opt 7 + ENV PATH=/opt/zig-linux-x86_64-0.15.2:$PATH 8 + WORKDIR /build 9 + COPY . . 10 + RUN zig build -Doptimize=ReleaseSafe 11 + 12 + FROM --platform=linux/amd64 alpine:3.21 13 RUN apk add --no-cache ca-certificates 14 + COPY --from=builder /build/zig-out/bin/zlay /usr/local/bin/zlay 15 RUN mkdir -p /data/events 16 ENV RELAY_DATA_DIR=/data/events 17 EXPOSE 3000 3001