ci: use rustup toolchain for musl builds
This commit is contained in:
parent
a8d545c019
commit
68da5140f8
1 changed files with 9 additions and 4 deletions
13
Dockerfile
13
Dockerfile
|
|
@ -1,17 +1,22 @@
|
|||
FROM registry.nxtgauge.com/rust:alpine AS builder
|
||||
RUN command -v cargo >/dev/null 2>&1 || apk add --no-cache cargo rust
|
||||
RUN apk add --no-cache musl-dev pkgconfig openssl-dev
|
||||
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
|
||||
COPY Cargo.toml Cargo.lock* ./
|
||||
COPY src ./src
|
||||
COPY migrations ./migrations
|
||||
COPY seeds ./seeds
|
||||
RUN cargo build --release
|
||||
ENV OPENSSL_STATIC=1
|
||||
ENV OPENSSL_DIR=/usr
|
||||
RUN cargo build --release --target x86_64-unknown-linux-musl
|
||||
|
||||
FROM registry.nxtgauge.com/alpine:3.20
|
||||
RUN apk add --no-cache ca-certificates
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/target/release/nxtgauge-ai-assistant /usr/local/bin/nxtgauge-ai-assistant
|
||||
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/nxtgauge-ai-assistant /usr/local/bin/nxtgauge-ai-assistant
|
||||
COPY --from=builder /app/migrations ./migrations
|
||||
COPY --from=builder /app/seeds ./seeds
|
||||
ENV APP_HOST=0.0.0.0
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue