synor/docker/zk-rollup/Dockerfile
Gulshan Yadav d73909d72c feat(phase13): complete Docker deployment and Phase 14 planning
Phase 13 Completion:
- Add ZK-Rollup Docker infrastructure (sequencer, provers, gateway)
- Create zk-sequencer binary with health checks and metrics
- Add docker-compose.zk.yml for full ZK stack deployment
- Include nginx gateway and Prometheus monitoring configs

Integration Tests:
- Add comprehensive Phase 13 integration test suite
- Cover DAGKnight, quantum crypto, ZK-rollup, gateway tests
- All 149 tests passing (39 DAG + 45 crypto + 25 ZK + 40 storage)

Phase 14 Planning:
- Document 4-milestone roadmap (20 weeks)
- M1: Cross-chain IBC interoperability
- M2: Privacy layer (RingCT, stealth addresses)
- M3: Sharding protocol (100K TPS target)
- M4: Developer tooling (formal verification, Hardhat)

Docker Services:
- synor-zk-sequencer: API port 3001, prover RPC 3002, metrics 9001
- synor-zk-prover-1/2: Dedicated proof generation workers
- synor-zk-gateway: nginx API gateway port 3080
- synor-zk-prometheus: Metrics collection port 9090
2026-01-19 16:09:44 +05:30

79 lines
1.8 KiB
Docker

# Synor ZK-Rollup Sequencer Dockerfile
# Multi-stage build for optimized production image
# Stage 1: Build
# Using latest stable Rust (edition2024 requires 1.85+)
FROM rust:latest AS builder
WORKDIR /build
# Install dependencies for arkworks cryptography
RUN apt-get update && apt-get install -y \
cmake \
libclang-dev \
libssl-dev \
pkg-config \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy workspace files
COPY Cargo.toml Cargo.lock ./
COPY crates/ ./crates/
COPY apps/ ./apps/
COPY contracts/ ./contracts/
# Build the ZK rollup binary with node features (async runtime, logging)
RUN cargo build --release -p synor-zk --features node --bin zk-sequencer
# Stage 2: Runtime
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y \
ca-certificates \
libssl3 \
curl \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user
RUN useradd -m -u 1000 synor
# Create data directories
RUN mkdir -p /data/zk /config /proofs && chown -R synor:synor /data /config /proofs
WORKDIR /app
# Copy the built binary
COPY --from=builder /build/target/release/zk-sequencer /app/zk-sequencer
# Copy configuration template
COPY docker/zk-rollup/config.toml /config/config.toml
# Make binary executable
RUN chmod +x /app/zk-sequencer && chown synor:synor /app/zk-sequencer
USER synor
# ZK Rollup ports
# 3001: Sequencer API
# 3002: Prover RPC
# 9001: Metrics
EXPOSE 3001 3002 9001
# Environment defaults
ENV RUST_LOG=info
ENV DATA_DIR=/data/zk
ENV PROOF_DIR=/proofs
ENV L1_RPC=http://synor-node-1:8545
ENV MAX_BATCH_SIZE=1000
ENV PROOF_BACKEND=groth16
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD curl -f http://localhost:3001/health || exit 1
# Data volumes
VOLUME ["/data/zk", "/proofs"]
# Entry point
ENTRYPOINT ["/app/zk-sequencer"]
CMD ["--config", "/config/config.toml"]