File tree Expand file tree Collapse file tree 5 files changed +91
-33
lines changed
Expand file tree Collapse file tree 5 files changed +91
-33
lines changed Original file line number Diff line number Diff line change 1- FROM rust:1-bookworm AS builder
1+ FROM rust:1-bookworm AS base
22
3+ RUN cargo install cargo-chef --locked
34WORKDIR /app
45
5- COPY Cargo.toml Cargo.lock ./
6- COPY crates/ ./crates/
6+ FROM base AS planner
7+ COPY . .
8+ RUN cargo chef prepare --recipe-path recipe.json
79
8- RUN cargo build --bin tips-audit
10+ FROM base AS builder
11+ COPY --from=planner /app/recipe.json recipe.json
912
10- FROM debian:bookworm
13+ RUN --mount=type=cache,target=/usr/local/cargo/registry \
14+ --mount=type=cache,target=/usr/local/cargo/git \
15+ --mount=type=cache,target=/app/target \
16+ cargo chef cook --release --recipe-path recipe.json
17+
18+ COPY . .
19+ RUN --mount=type=cache,target=/usr/local/cargo/registry \
20+ --mount=type=cache,target=/usr/local/cargo/git \
21+ --mount=type=cache,target=/app/target \
22+ cargo build --release --bin tips-audit && \
23+ cp target/release/tips-audit /tmp/tips-audit
24+
25+ FROM debian:bookworm-slim
1126
1227RUN apt-get update && apt-get install -y libssl3 ca-certificates && rm -rf /var/lib/apt/lists/*
1328
1429WORKDIR /app
1530
16- COPY --from=builder /app/target/debug /tips-audit /app/tips-audit
31+ COPY --from=builder /tmp /tips-audit /app/tips-audit
1732
1833EXPOSE 3001
1934
Original file line number Diff line number Diff line change 1- FROM rust:1-bookworm AS builder
1+ FROM rust:1-bookworm AS base
22
3+ RUN cargo install cargo-chef --locked
34WORKDIR /app
45
5- COPY Cargo.toml Cargo.lock ./
6- COPY crates/ ./crates/
7- COPY .sqlx/ ./.sqlx/
6+ FROM base AS planner
7+ COPY . .
8+ RUN cargo chef prepare --recipe-path recipe.json
89
9- RUN cargo build --bin tips-ingress-rpc
10+ FROM base AS builder
11+ COPY --from=planner /app/recipe.json recipe.json
1012
11- FROM debian:bookworm
13+ RUN --mount=type=cache,target=/usr/local/cargo/registry \
14+ --mount=type=cache,target=/usr/local/cargo/git \
15+ --mount=type=cache,target=/app/target \
16+ cargo chef cook --release --recipe-path recipe.json
1217
13- RUN apt-get update && apt-get install -y libssl3 && rm -rf /var/lib/apt/lists/*
18+ COPY . .
19+ RUN --mount=type=cache,target=/usr/local/cargo/registry \
20+ --mount=type=cache,target=/usr/local/cargo/git \
21+ --mount=type=cache,target=/app/target \
22+ cargo build --release --bin tips-ingress-rpc && \
23+ cp target/release/tips-ingress-rpc /tmp/tips-ingress-rpc
24+
25+ FROM debian:bookworm-slim
26+
27+ RUN apt-get update && apt-get install -y libssl3 ca-certificates && rm -rf /var/lib/apt/lists/*
1428
1529WORKDIR /app
1630
17- COPY --from=builder /app/target/debug /tips-ingress-rpc /app/tips-ingress-rpc
31+ COPY --from=builder /tmp /tips-ingress-rpc /app/tips-ingress-rpc
1832
1933EXPOSE 3000
2034
Original file line number Diff line number Diff line change 1- FROM rust:1-bookworm AS builder
1+ FROM rust:1-bookworm AS base
22
3+ RUN cargo install cargo-chef --locked
34WORKDIR /app
45
5- COPY Cargo.toml Cargo.lock ./
6- COPY crates/ ./crates/
7- COPY .sqlx/ ./.sqlx/
6+ FROM base AS planner
7+ COPY . .
8+ RUN cargo chef prepare --recipe-path recipe.json
89
9- RUN cargo build --bin tips-ingress-writer
10+ FROM base AS builder
11+ COPY --from=planner /app/recipe.json recipe.json
1012
11- FROM debian:bookworm
13+ RUN --mount=type=cache,target=/usr/local/cargo/registry \
14+ --mount=type=cache,target=/usr/local/cargo/git \
15+ --mount=type=cache,target=/app/target \
16+ cargo chef cook --release --recipe-path recipe.json
1217
13- RUN apt-get update && apt-get install -y libssl3 && rm -rf /var/lib/apt/lists/*
18+ COPY . .
19+ RUN --mount=type=cache,target=/usr/local/cargo/registry \
20+ --mount=type=cache,target=/usr/local/cargo/git \
21+ --mount=type=cache,target=/app/target \
22+ cargo build --release --bin tips-ingress-writer && \
23+ cp target/release/tips-ingress-writer /tmp/tips-ingress-writer
24+
25+ FROM debian:bookworm-slim
26+
27+ RUN apt-get update && apt-get install -y libssl3 ca-certificates && rm -rf /var/lib/apt/lists/*
1428
1529WORKDIR /app
1630
17- COPY --from=builder /app/target/debug /tips-ingress-writer /app/tips-ingress-writer
31+ COPY --from=builder /tmp /tips-ingress-writer /app/tips-ingress-writer
1832
1933CMD ["/app/tips-ingress-writer" ]
Original file line number Diff line number Diff line change 1- FROM rust:1-bookworm AS builder
1+ FROM rust:1-bookworm AS base
22
3+ RUN cargo install cargo-chef --locked
34WORKDIR /app
45
5- COPY Cargo.toml Cargo.lock ./
6- COPY crates/ ./crates/
7- COPY .sqlx/ ./.sqlx/
6+ FROM base AS planner
7+ COPY . .
8+ RUN cargo chef prepare --recipe-path recipe.json
89
9- RUN cargo build --bin tips-maintenance
10+ FROM base AS builder
11+ COPY --from=planner /app/recipe.json recipe.json
1012
11- FROM debian:bookworm
13+ RUN --mount=type=cache,target=/usr/local/cargo/registry \
14+ --mount=type=cache,target=/usr/local/cargo/git \
15+ --mount=type=cache,target=/app/target \
16+ cargo chef cook --release --recipe-path recipe.json
1217
13- RUN apt-get update && apt-get install -y libssl3 && rm -rf /var/lib/apt/lists/*
18+ COPY . .
19+ RUN --mount=type=cache,target=/usr/local/cargo/registry \
20+ --mount=type=cache,target=/usr/local/cargo/git \
21+ --mount=type=cache,target=/app/target \
22+ cargo build --release --bin tips-maintenance && \
23+ cp target/release/tips-maintenance /tmp/tips-maintenance
24+
25+ FROM debian:bookworm-slim
26+
27+ RUN apt-get update && apt-get install -y libssl3 ca-certificates && rm -rf /var/lib/apt/lists/*
1428
1529WORKDIR /app
1630
17- COPY --from=builder /app/target/debug /tips-maintenance /app/tips-maintenance
31+ COPY --from=builder /tmp /tips-maintenance /app/tips-maintenance
1832
1933CMD ["/app/tips-maintenance" ]
Original file line number Diff line number Diff line change 11FROM node:20-alpine AS deps
22WORKDIR /app
33COPY ui/package.json ui/yarn.lock ./
4- RUN yarn install --frozen-lockfile
4+ RUN --mount=type=cache,target=/root/.yarn \
5+ yarn install --frozen-lockfile
56
67FROM node:20-alpine AS builder
78WORKDIR /app
@@ -10,7 +11,8 @@ COPY ./ui .
1011
1112ENV NEXT_TELEMETRY_DISABLED=1
1213
13- RUN yarn build
14+ RUN --mount=type=cache,target=/app/.next/cache \
15+ yarn build
1416
1517FROM node:20-alpine AS runner
1618WORKDIR /app
@@ -21,7 +23,6 @@ ENV NEXT_TELEMETRY_DISABLED=1
2123RUN addgroup --system --gid 1001 nodejs
2224RUN adduser --system --uid 1001 nextjs
2325
24-
2526RUN mkdir .next
2627RUN chown nextjs:nodejs .next
2728
You can’t perform that action at this time.
0 commit comments