ci: migrasi CI/Dockerfile/install.sh ke Bun — setup-bun + bun install/check/test + --compile single binary; release gate ke bun run check

This commit is contained in:
asepharyana
2026-09-02 22:50:38 +07:00
parent 5d65c78fb4
commit 170b1d3d19
5 changed files with 63 additions and 52 deletions
+13 -14
View File
@@ -1,30 +1,29 @@
# syntax=docker/dockerfile:1
# Zesdex — Multi-stage Docker build
# ===================================
# Stage 1: Build with Rust toolchain
FROM rust:1.85-slim-bookworm AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config libsqlite3-dev && \
rm -rf /var/lib/apt/lists/*
# Zesdex — Multi-stage Docker build (Bun)
# ========================================
# Stage 1: Build with Bun → compile single self-contained CLI binary
FROM oven/bun:1.2 AS builder
WORKDIR /app
COPY . .
COPY bun.lockb bun.lock ./
COPY package.json tsconfig.json ./
COPY apps ./apps
# Build with release profile (treats warnings as errors via lints)
RUN cargo build --release -p zesdex-gateway --bin zesdex
RUN bun install --frozen-lockfile
# Compile a standalone self-contained executable (bundles JS + native addons).
RUN bun build apps/interfaces/cli/src/index.ts --compile --outfile=/app/zesdex
# Stage 2: Minimal runtime image
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates libsqlite3-0 && \
ca-certificates && \
rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/target/release/zesdex /usr/local/bin/zesdex
COPY --from=builder /app/zesdex /usr/local/bin/zesdex
ENV ZESDEX_DATA_DIR=/data
VOLUME ["/data"]
ENTRYPOINT ["/usr/local/bin/zesdex"]