2026-04-17 01:39:21 +02:00
|
|
|
FROM registry.nxtgauge.com/rust:alpine AS builder
|
2026-04-12 21:57:28 +02:00
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
2026-04-17 03:10:14 +02:00
|
|
|
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
|
2026-04-12 21:57:28 +02:00
|
|
|
|
|
|
|
|
COPY Cargo.toml Cargo.lock ./
|
|
|
|
|
COPY crates/db-migrate ./crates/db-migrate
|
|
|
|
|
COPY crates/db ./crates/db
|
|
|
|
|
COPY crates/cache ./crates/cache
|
|
|
|
|
COPY crates/email ./crates/email
|
|
|
|
|
|
|
|
|
|
WORKDIR /app/crates/db-migrate
|
2026-04-17 03:10:14 +02:00
|
|
|
ENV OPENSSL_STATIC=1
|
|
|
|
|
ENV OPENSSL_DIR=/usr
|
|
|
|
|
RUN cargo build --release --bin db-migrate --target x86_64-unknown-linux-musl
|
2026-04-12 21:57:28 +02:00
|
|
|
|
|
|
|
|
FROM alpine:3.19
|
|
|
|
|
RUN apk add --no-cache ca-certificates libpq
|
|
|
|
|
|
2026-04-17 03:10:14 +02:00
|
|
|
COPY --from=builder /app/crates/db-migrate/target/x86_64-unknown-linux-musl/release/db-migrate /usr/local/bin/
|
2026-04-12 21:57:28 +02:00
|
|
|
COPY crates/db/migrations /migrations
|
|
|
|
|
|
|
|
|
|
ENTRYPOINT ["db-migrate"]
|