nxtgauge-backend-rust/Dockerfile.template
Ashwin Kumar Sivakumar f7d0f6f9f5
Some checks failed
build-and-release / build (companies) (push) Failing after 39s
build-and-release / build (catering-services) (push) Failing after 57s
build-and-release / build (cron) (push) Failing after 1m4s
build-and-release / build (gateway) (push) Successful in 3m46s
build-and-release / build (fitness-trainers) (push) Successful in 9m8s
build-and-release / build (graphic-designers) (push) Successful in 8m58s
build-and-release / build (employees) (push) Successful in 9m17s
build-and-release / build (customers) (push) Successful in 9m47s
build-and-release / build (developers) (push) Successful in 9m48s
build-and-release / build (job-seekers) (push) Successful in 9m1s
build-and-release / build (jobs) (push) Successful in 4m17s
build-and-release / build (leads) (push) Successful in 8m23s
build-and-release / build (makeup-artists) (push) Successful in 8m40s
build-and-release / build (payments) (push) Successful in 9m21s
build-and-release / build (photographers) (push) Successful in 9m20s
build-and-release / build (social-media-managers) (push) Successful in 8m9s
build-and-release / build (tutors) (push) Successful in 8m16s
build-and-release / build (ugc-content-creators) (push) Successful in 6m59s
build-and-release / build (video-editors) (push) Successful in 6m9s
build-and-release / build (users) (push) Successful in 8m37s
fix: Update Dockerfiles to use ci.nxtgauge.com registry
2026-07-08 03:37:18 +05:30

37 lines
926 B
Text

# Build stage
FROM ci.nxtgauge.com/admin/rust:alpine AS builder
WORKDIR /usr/src/app
# Install build dependencies and musl target
RUN apk add --no-cache musl-dev pkgconfig openssl-dev && \
rustup target add x86_64-unknown-linux-musl
# Copy manifests
COPY Cargo.toml Cargo.lock ./
COPY crates ./crates
COPY apps ./apps
# Build static binary with musl target
ENV RUSTFLAGS='-C target-feature=+crt-static'
RUN cargo build --release --bin ${BIN_NAME} --target x86_64-unknown-linux-musl
# Runtime stage - minimal Alpine
FROM ci.nxtgauge.com/admin/alpine:latest AS runtime
# Install CA certificates only
RUN apk add --no-cache ca-certificates
# Create app user
RUN adduser -D -u 1000 appuser
WORKDIR /app
# Copy static binary from builder
COPY --from=builder /usr/src/app/target/x86_64-unknown-linux-musl/release/${BIN_NAME} ./${BIN_NAME}
# Switch to non-root user
USER appuser
# Run the binary
CMD ["./${BIN_NAME}"]