mirror of
https://github.com/getnora-io/nora.git
synced 2026-04-12 06:50:31 +00:00
Add Dockerfile.astra (astralinux/alse) and Dockerfile.redos (redos/redos) for FSTEC-certified Russian OS targets. Update release.yml with a matrix strategy that produces three image variants per release: - ghcr.io/.../nora:0.x.x (Alpine, default) - ghcr.io/.../nora:0.x.x-astra (Astra Linux SE) - ghcr.io/.../nora:0.x.x-redos (RED OS) Build stage is shared (musl static binary) across all variants.
66 lines
1.9 KiB
Docker
66 lines
1.9 KiB
Docker
# syntax=docker/dockerfile:1.4
|
|
|
|
# Build stage — static binary via musl (runs on any Linux)
|
|
FROM rust:1.83-alpine AS builder
|
|
|
|
RUN apk add --no-cache musl-dev curl
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy manifests
|
|
COPY Cargo.toml Cargo.lock ./
|
|
COPY nora-registry/Cargo.toml nora-registry/
|
|
COPY nora-storage/Cargo.toml nora-storage/
|
|
COPY nora-cli/Cargo.toml nora-cli/
|
|
|
|
# Create dummy sources for dependency caching
|
|
RUN mkdir -p nora-registry/src nora-storage/src nora-cli/src && \
|
|
echo "fn main() {}" > nora-registry/src/main.rs && \
|
|
echo "fn main() {}" > nora-storage/src/main.rs && \
|
|
echo "fn main() {}" > nora-cli/src/main.rs
|
|
|
|
# Build dependencies only (with cache)
|
|
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
|
--mount=type=cache,target=/usr/local/cargo/git \
|
|
--mount=type=cache,target=/app/target \
|
|
cargo build --release --package nora-registry && \
|
|
rm -rf nora-registry/src nora-storage/src nora-cli/src
|
|
|
|
# Copy real sources
|
|
COPY nora-registry/src nora-registry/src
|
|
COPY nora-storage/src nora-storage/src
|
|
COPY nora-cli/src nora-cli/src
|
|
|
|
# Build release binary (with cache)
|
|
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
|
--mount=type=cache,target=/usr/local/cargo/git \
|
|
--mount=type=cache,target=/app/target \
|
|
touch nora-registry/src/main.rs && \
|
|
cargo build --release --package nora-registry && \
|
|
cp /app/target/release/nora /usr/local/bin/nora
|
|
|
|
# Runtime stage — Astra Linux Special Edition (certified FSTEC OS)
|
|
FROM astralinux/alse:latest
|
|
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends ca-certificates && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN mkdir -p /data
|
|
|
|
COPY --from=builder /usr/local/bin/nora /usr/local/bin/nora
|
|
|
|
ENV RUST_LOG=info
|
|
ENV NORA_HOST=0.0.0.0
|
|
ENV NORA_PORT=4000
|
|
ENV NORA_STORAGE_MODE=local
|
|
ENV NORA_STORAGE_PATH=/data/storage
|
|
ENV NORA_AUTH_TOKEN_STORAGE=/data/tokens
|
|
|
|
EXPOSE 4000
|
|
|
|
VOLUME ["/data"]
|
|
|
|
ENTRYPOINT ["/usr/local/bin/nora"]
|
|
CMD ["serve"]
|