-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
31 lines (21 loc) · 860 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
# syntax=docker/dockerfile:1.3-labs
FROM rust:latest AS build
RUN cargo new --lib /performance-service
COPY Cargo.toml Cargo.lock /performance-service/
WORKDIR /performance-service
RUN --mount=type=cache,target=/usr/local/cargo/registry cargo build --release
COPY . /performance-service
RUN --mount=type=cache,target=/usr/local/cargo/registry <<EOF
set -e
# update timestamps to force a new build
touch /performance-service/src/main.rs
cargo build --release
EOF
FROM debian:bookworm-slim AS runtime
WORKDIR /performance-service
COPY scripts /scripts
COPY migrations /migrations
RUN apt update && apt install -y openssl python3-pip git
RUN pip install --break-system-packages git+https://github.com/osuAkatsuki/akatsuki-cli
COPY --from=build /performance-service/target/release/performance-service /usr/local/bin
CMD ["/scripts/bootstrap.sh"]