nxtgauge-backend-rust/Dockerfile.working
Ashwin Kumar Sivakumar c85e6af22e feat(ai): complete AI plans/credits implementation and build tooling
- Add AI plans, credits, model routing, LiteLLM client, and orchestrator services
- Add AI management endpoints, auto-apply/auto-request handlers, and log endpoints
- Add cron jobs for daily action reset and monthly credit reset
- Add AI credit purchase flow in payments service
- Add ai_credit_packages migration with seed data
- Update Dockerfile build tooling across services
2026-06-15 06:15:49 +05:30

40 lines
1.1 KiB
Text

# Simple fast Dockerfile - preserves full workspace
FROM registry.nxtgauge.com/rust:alpine AS builder
# Install build deps
RUN apk add --no-cache curl ca-certificates bash build-base musl-dev pkgconfig openssl-dev openssl-libs-static
RUN update-ca-certificates
RUN curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable
ENV PATH="/root/.cargo/bin:${PATH}"
RUN rustup target add x86_64-unknown-linux-musl
WORKDIR /app
ARG SERVICE_NAME
# Copy full workspace (for dependencies)
COPY Cargo.toml Cargo.lock ./
COPY crates/ ./crates/
COPY apps/ ./apps/
# Build with all optimizations
ENV RUSTFLAGS="-C target-feature=+crt-static -C link-arg=-s"
ENV OPENSSL_STATIC=1
ENV OPENSSL_DIR=/usr
RUN svc=$(echo "${SERVICE_NAME}" | tr '-' '_') && \
cargo build --release \
--bin ${svc} \
--target x86_64-unknown-linux-musl && \
cp /app/target/x86_64-unknown-linux-musl/release/${svc} /app/service
# Runtime
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /app/service /app/service
USER 65532:65532
EXPOSE 8000
ENTRYPOINT ["/app/service"]