-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (21 loc) · 970 Bytes
/
Dockerfile
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
FROM rust:1.77 as builder
RUN mkdir -p /build/openworkers-runner
ENV RUST_BACKTRACE=1
ENV RUNTIME_SNAPSHOT_PATH=/build/snapshot.bin
WORKDIR /build/openworkers-runner
COPY . /build/openworkers-runner
RUN touch $RUNTIME_SNAPSHOT_PATH
RUN --mount=type=cache,target=$CARGO_HOME/git \
--mount=type=cache,target=$CARGO_HOME/registry \
--mount=type=cache,target=/build/openworkers-runner/target \
cargo run --release --bin snapshot && \
# Build the runner and copy executable out of the cache so it can be used in the next stage
cargo build --release && cp /build/openworkers-runner/target/release/openworkers-runner /build/output
FROM debian:bookworm-slim
RUN apt-get update \
# Install ca-certificates and wget (used for healthcheck)
&& apt-get install -y ca-certificates wget \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /build/output /usr/local/bin/openworkers-runner
CMD ["/usr/local/bin/openworkers-runner"]
EXPOSE 8080