4NK_certificator/Dockerfile
4NK Dev 4acfa96a5c feat: initial commit - 4NK Certificator service
- Bitcoin mainnet anchoring service for 4NK relay data volumes
- REST API for processes, metrics, and anchors
- PostgreSQL database with SQLx
- Docker support with compose file
- Configuration via TOML
- Periodic anchoring based on block intervals
- Conditional payment system (priceMoSats, btcAddress)
- Process state snapshot with cryptographic hash
- Health check endpoint

Version: 0.1.0 (MVP)
2025-10-01 09:35:33 +00:00

47 lines
865 B
Docker

FROM rust:1.75-slim as builder
WORKDIR /build
# Install dependencies
RUN apt-get update && apt-get install -y \
pkg-config \
libssl-dev \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy manifests
COPY Cargo.toml Cargo.lock ./
# Copy source
COPY src ./src
# Build release
RUN cargo build --release
# Runtime image
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y \
ca-certificates \
libpq5 \
curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy binary from builder
COPY --from=builder /build/target/release/4nk_certificator /app/4nk_certificator
# Create logs directory
RUN mkdir -p /var/log/4nk_certificator
# Expose port
EXPOSE 8082
# Health check
HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
CMD curl -f http://localhost:8082/health || exit 1
# Run
CMD ["/app/4nk_certificator"]