-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (31 loc) · 1.02 KB
/
Dockerfile
File metadata and controls
39 lines (31 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM lukemathwalker/cargo-chef:latest-rust-1 AS chef
WORKDIR /app
# Bun builder stage
FROM node:22.15.0-slim AS bun-builder
RUN apt-get update && apt-get install -y curl unzip ca-certificates && \
curl -fsSL https://bun.sh/install | bash && \
ln -s /root/.bun/bin/bun /usr/local/bin/bun
WORKDIR /app
COPY . .
RUN bun install
RUN bun run build
FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY . .
COPY --from=planner /app/recipe.json recipe.json
# Build dependencies - this is the caching Docker layer!
RUN cargo chef cook --release --recipe-path recipe.json
# Build application
COPY . .
RUN cargo build --release
# # We do not need the Rust toolchain to run the binary!
FROM debian:bookworm-slim AS runtime
RUN apt-get update && apt-get install -y bash
WORKDIR /usr/local/bin
COPY --from=bun-builder /app/dist /usr/local/bin/dist
COPY --from=builder /app/target/release/HyperSync /usr/local/bin
RUN ls -l /usr/local/bin
EXPOSE 3000
ENTRYPOINT ["/usr/local/bin/HyperSync"]