armature-framework 0.2.2

A modern, type-safe HTTP framework for Rust inspired by Angular and NestJS. Features dependency injection, decorators, middleware, authentication (JWT/OAuth2/SAML), validation, OpenAPI/Swagger, caching, job queues, and observability.
# Armature Microservice Dockerfile
# Generic template for individual services

ARG SERVICE_NAME=service

# Build stage
FROM rust:1.83-alpine AS builder

ARG SERVICE_NAME
WORKDIR /app

RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static pkgconfig

COPY Cargo.toml Cargo.lock ./
COPY armature-core/Cargo.toml armature-core/
COPY armature-proc-macro/Cargo.toml armature-proc-macro/
COPY armature-log/Cargo.toml armature-log/

# Stub files for dependency caching
RUN mkdir -p armature-core/src armature-proc-macro/src armature-log/src && \
    echo "fn main() {}" > armature-core/src/lib.rs && \
    echo "fn main() {}" > armature-proc-macro/src/lib.rs && \
    echo "fn main() {}" > armature-log/src/lib.rs

RUN cargo build --release 2>/dev/null || true

COPY . .

# Build service example (replace with actual service in production)
RUN cargo build --release --example rest_api && \
    strip /app/target/release/examples/rest_api

# Runtime stage
FROM alpine:3.19

WORKDIR /app

RUN apk add --no-cache ca-certificates curl && \
    adduser -D -u 1000 armature

COPY --from=builder /app/target/release/examples/rest_api /app/service

USER armature

EXPOSE 3000

HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
    CMD curl -f http://localhost:3000/health || exit 1

ENTRYPOINT ["/app/service"]