mirror of
https://github.com/beshu-tech/deltaglider.git
synced 2026-03-18 15:23:52 +01:00
Added complete documentation for all environment variables across Dockerfile, README.md, and SDK documentation. Dockerfile Changes: - Documented all DeltaGlider environment variables with defaults - Added AWS configuration variables (commented for runtime override) - Updated version label to 5.0.3 - Updated description to mention encryption README.md Changes: - Added comprehensive Docker Usage section - Documented all environment variables with examples - Added Docker examples for: * Basic usage with AWS credentials * Memory cache configuration for CI/CD * MinIO/custom endpoint usage * Persistent encryption key setup - Security notes for encryption and cache behavior SDK Documentation Changes: - Added DeltaGlider Configuration section - Documented all environment variables - Added configuration examples - Security notes for encryption behavior Environment Variables Documented: - DG_LOG_LEVEL (logging configuration) - DG_MAX_RATIO (compression threshold) - DG_CACHE_BACKEND (filesystem or memory) - DG_CACHE_MEMORY_SIZE_MB (memory cache size) - DG_CACHE_ENCRYPTION_KEY (optional persistent key) - AWS_ENDPOINT_URL (custom S3 endpoints) - AWS_ACCESS_KEY_ID (AWS credentials) - AWS_SECRET_ACCESS_KEY (AWS credentials) - AWS_DEFAULT_REGION (AWS region) Quality Checks: - All 119 tests passing ✅ - Type checking: 0 errors (mypy) ✅ - Linting: All checks passed (ruff) ✅ - Dockerfile syntax validated ✅ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
95 lines
3.1 KiB
Docker
95 lines
3.1 KiB
Docker
# Multi-stage build for deltaglider
|
|
ARG PYTHON_VERSION=3.12-slim
|
|
ARG UV_VERSION=0.5.13
|
|
|
|
# Builder stage - install UV and dependencies
|
|
FROM ghcr.io/astral-sh/uv:$UV_VERSION AS uv
|
|
FROM python:${PYTHON_VERSION} AS builder
|
|
|
|
# Copy UV from the UV image
|
|
COPY --from=uv /uv /usr/local/bin/uv
|
|
ENV UV_SYSTEM_PYTHON=1
|
|
|
|
WORKDIR /build
|
|
|
|
# Copy dependency files first for better caching
|
|
COPY pyproject.toml ./
|
|
COPY README.md ./
|
|
|
|
# Install dependencies with UV caching
|
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
uv pip install --compile-bytecode .
|
|
|
|
# Copy source code
|
|
COPY src ./src
|
|
|
|
# Install the package (force reinstall to ensure it's properly installed)
|
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
uv pip install --compile-bytecode --no-deps --force-reinstall .
|
|
|
|
# Runtime stage - minimal image
|
|
FROM python:${PYTHON_VERSION}
|
|
|
|
# Skip man pages and docs to speed up builds
|
|
RUN mkdir -p /etc/dpkg/dpkg.cfg.d && \
|
|
echo 'path-exclude /usr/share/doc/*' > /etc/dpkg/dpkg.cfg.d/01_nodoc && \
|
|
echo 'path-exclude /usr/share/man/*' >> /etc/dpkg/dpkg.cfg.d/01_nodoc && \
|
|
echo 'path-exclude /usr/share/groff/*' >> /etc/dpkg/dpkg.cfg.d/01_nodoc && \
|
|
echo 'path-exclude /usr/share/info/*' >> /etc/dpkg/dpkg.cfg.d/01_nodoc && \
|
|
echo 'path-exclude /usr/share/lintian/*' >> /etc/dpkg/dpkg.cfg.d/01_nodoc && \
|
|
echo 'path-exclude /usr/share/linda/*' >> /etc/dpkg/dpkg.cfg.d/01_nodoc
|
|
|
|
# Install xdelta3 (now much faster without man pages)
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends xdelta3 && \
|
|
apt-get clean && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Create non-root user
|
|
RUN useradd -m -u 1000 -s /bin/bash deltaglider
|
|
|
|
# Copy installed packages from builder
|
|
COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
|
|
COPY --from=builder /usr/local/bin/deltaglider /usr/local/bin/deltaglider
|
|
|
|
# Set up working directory
|
|
WORKDIR /app
|
|
RUN chown -R deltaglider:deltaglider /app
|
|
|
|
# Create cache directory with proper permissions
|
|
RUN mkdir -p /tmp/.deltaglider && \
|
|
chown -R deltaglider:deltaglider /tmp/.deltaglider
|
|
|
|
USER deltaglider
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
CMD deltaglider --help || exit 1
|
|
|
|
# Environment variables (all optional, can be overridden at runtime)
|
|
# Logging
|
|
ENV DG_LOG_LEVEL=INFO
|
|
|
|
# Performance & Compression
|
|
ENV DG_MAX_RATIO=0.5
|
|
|
|
# Cache Configuration
|
|
ENV DG_CACHE_BACKEND=filesystem
|
|
ENV DG_CACHE_MEMORY_SIZE_MB=100
|
|
# ENV DG_CACHE_ENCRYPTION_KEY=<base64-key> # Optional: Set for cross-process cache sharing
|
|
|
|
# AWS Configuration (override at runtime)
|
|
# ENV AWS_ENDPOINT_URL=https://s3.amazonaws.com
|
|
# ENV AWS_ACCESS_KEY_ID=<your-key>
|
|
# ENV AWS_SECRET_ACCESS_KEY=<your-secret>
|
|
# ENV AWS_DEFAULT_REGION=us-east-1
|
|
|
|
# Labels
|
|
LABEL org.opencontainers.image.title="DeltaGlider" \
|
|
org.opencontainers.image.description="Delta-aware S3 file storage wrapper with encryption" \
|
|
org.opencontainers.image.version="5.0.3" \
|
|
org.opencontainers.image.authors="Beshu Limited" \
|
|
org.opencontainers.image.source="https://github.com/beshu-tech/deltaglider"
|
|
|
|
ENTRYPOINT ["deltaglider"]
|
|
CMD ["--help"] |