|
| 1 | +# SPDX-License-Identifier: AGPL-3.0-or-later |
| 2 | +# Cloud Sync Tuner - Wolfi-based container |
| 3 | +# Build with: nerdctl build -t cloud-sync-tuner . |
| 4 | + |
| 5 | +# Stage 1: Build environment (Wolfi with GNAT) |
| 6 | +FROM cgr.dev/chainguard/wolfi-base:latest AS builder |
| 7 | + |
| 8 | +# Install build dependencies |
| 9 | +RUN apk add --no-cache \ |
| 10 | + gcc \ |
| 11 | + gnat \ |
| 12 | + gprbuild \ |
| 13 | + make \ |
| 14 | + git |
| 15 | + |
| 16 | +WORKDIR /build |
| 17 | + |
| 18 | +# Copy source files |
| 19 | +COPY src/ src/ |
| 20 | +COPY cloud_sync_tuner.gpr . |
| 21 | + |
| 22 | +# Build the application |
| 23 | +RUN mkdir -p obj bin && \ |
| 24 | + gprbuild -P cloud_sync_tuner.gpr -XBUILD_MODE=release |
| 25 | + |
| 26 | +# Stage 2: Runtime environment (minimal Wolfi) |
| 27 | +FROM cgr.dev/chainguard/wolfi-base:latest AS runtime |
| 28 | + |
| 29 | +# Install runtime dependencies only |
| 30 | +RUN apk add --no-cache \ |
| 31 | + rclone \ |
| 32 | + fuse3 \ |
| 33 | + libgcc |
| 34 | + |
| 35 | +# Create non-root user |
| 36 | +RUN adduser -D -h /home/tuner tuner |
| 37 | +USER tuner |
| 38 | +WORKDIR /home/tuner |
| 39 | + |
| 40 | +# Copy binary from builder |
| 41 | +COPY --from=builder /build/bin/cloud_sync_tuner /usr/local/bin/ |
| 42 | + |
| 43 | +# Copy default config template |
| 44 | +COPY --chown=tuner:tuner config/ /home/tuner/.config/cloud-sync-tuner/ |
| 45 | + |
| 46 | +# Volume for output service files |
| 47 | +VOLUME ["/home/tuner/output"] |
| 48 | + |
| 49 | +# Default to interactive TUI mode |
| 50 | +ENTRYPOINT ["/usr/local/bin/cloud_sync_tuner"] |
| 51 | + |
| 52 | +# Health check |
| 53 | +HEALTHCHECK --interval=30s --timeout=3s \ |
| 54 | + CMD ["/usr/local/bin/cloud_sync_tuner", "--version"] || exit 1 |
| 55 | + |
| 56 | +LABEL org.opencontainers.image.title="Cloud Sync Tuner" \ |
| 57 | + org.opencontainers.image.description="TUI for managing rclone cloud mount configurations" \ |
| 58 | + org.opencontainers.image.source="https://github.com/hyperpolymath/cloud-sync-tuner" \ |
| 59 | + org.opencontainers.image.licenses="AGPL-3.0-or-later" \ |
| 60 | + org.opencontainers.image.vendor="hyperpolymath" |
0 commit comments