synor/Dockerfile
Gulshan Yadav 1606776394 feat: Phase 7 critical tasks - security, formal verification, WASM crypto
## Formal Verification
- Add TLA+ specs for UTXO conservation (formal/tla/UTXOConservation.tla)
- Add TLA+ specs for GHOSTDAG ordering (formal/tla/GHOSTDAGOrdering.tla)
- Add mathematical proof of DAA convergence (formal/proofs/)
- Document Kani verification approach (formal/kani/)

## Bug Bounty Program
- Add SECURITY.md with vulnerability disclosure process
- Add docs/BUG_BOUNTY.md with $500-$100,000 reward tiers
- Define scope, rules, and response SLA

## Web Wallet Dilithium3 WASM Integration
- Build WASM module via Docker (498KB optimized)
- Add wasm-crypto.ts lazy loader for Dilithium3
- Add createHybridSignatureLocal() for full client-side signing
- Add createHybridSignatureSmart() for auto-mode selection
- Add Dockerfile.wasm and build scripts

## Security Review ($0 Approach)
- Add .github/workflows/security.yml CI workflow
- Add deny.toml for cargo-deny license/security checks
- Add Dockerfile.security for audit container
- Add scripts/security-audit.sh for local audits
- Configure cargo-audit, cargo-deny, cargo-geiger, gitleaks
2026-01-10 01:40:03 +05:30

78 lines
2 KiB
Docker

# Synor Blockchain Node Dockerfile
# Multi-stage build for minimal production image
# =============================================================================
# Stage 1: Build Environment
# =============================================================================
FROM rust:1.85-bookworm AS builder
# Install build dependencies
RUN apt-get update && apt-get install -y \
cmake \
clang \
libclang-dev \
pkg-config \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
# Create app directory
WORKDIR /app
# Copy manifests first (for better caching)
COPY Cargo.toml Cargo.lock ./
COPY crates/ crates/
COPY apps/ apps/
COPY contracts/ contracts/
COPY sdk/ sdk/
# Build release binary
RUN cargo build --release --bin synord
# =============================================================================
# Stage 2: Runtime Environment
# =============================================================================
FROM debian:bookworm-slim AS runtime
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
ca-certificates \
libssl3 \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user for security
RUN useradd --create-home --shell /bin/bash synor
# Create data directories
RUN mkdir -p /data/synor && chown -R synor:synor /data
# Copy binary from builder
COPY --from=builder /app/target/release/synord /usr/local/bin/synord
# Copy entrypoint script
COPY scripts/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Switch to non-root user
USER synor
# Set working directory
WORKDIR /home/synor
# Expose ports
# P2P network
EXPOSE 17511
# HTTP RPC
EXPOSE 17110
# WebSocket RPC
EXPOSE 17111
# Data volume
VOLUME ["/data/synor"]
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD synord --version || exit 1
# Default command - use entrypoint script which handles init
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["run"]