- Add comprehensive README with installation guides for: - Desktop wallet (macOS DMG, Windows MSI/EXE, Linux AppImage) - Node daemon (pre-built binaries and Docker) - Build from source instructions - CLI usage and RPC API examples - Configuration reference - Fix Dockerfiles: simplify build context, use -p package flag - Fix unstable Rust feature: replace is_multiple_of with modulo operator
69 lines
1.8 KiB
Text
69 lines
1.8 KiB
Text
# Synor Testnet Faucet 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 src/ src/
|
|
COPY crates/ crates/
|
|
COPY apps/ apps/
|
|
|
|
# Build release binary (using -p for package, synor-faucet includes the bin)
|
|
RUN cargo build --release -p synor-faucet
|
|
|
|
# =============================================================================
|
|
# Stage 2: Runtime Environment
|
|
# =============================================================================
|
|
FROM debian:bookworm-slim AS runtime
|
|
|
|
# Install runtime dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
ca-certificates \
|
|
libssl3 \
|
|
curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Create non-root user for security
|
|
RUN useradd --create-home --shell /bin/bash faucet
|
|
|
|
# Copy binary from builder
|
|
COPY --from=builder /app/target/release/synor-faucet /usr/local/bin/synor-faucet
|
|
|
|
# Switch to non-root user
|
|
USER faucet
|
|
|
|
# Set working directory
|
|
WORKDIR /home/faucet
|
|
|
|
# Expose HTTP port
|
|
EXPOSE 8080
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
|
|
CMD curl -f http://localhost:8080/health || exit 1
|
|
|
|
# Environment variables with defaults
|
|
ENV SYNOR_RPC_URL=http://localhost:17110
|
|
ENV FAUCET_AMOUNT=1000000000
|
|
ENV FAUCET_COOLDOWN=3600
|
|
ENV FAUCET_LISTEN_ADDR=0.0.0.0:8080
|
|
ENV RUST_LOG=info
|
|
|
|
# Default command
|
|
ENTRYPOINT ["synor-faucet"]
|