-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
34 lines (28 loc) · 877 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
33
34
FROM clux/muslrust:nightly as chef
RUN cargo install cargo-chef
WORKDIR /app
FROM chef as planner
COPY . .
RUN cargo chef prepare
FROM chef as cacher
COPY --from=planner /app/recipe.json recipe.json
ENV RUSTFLAGS --cfg tokio_unstable
RUN cargo chef cook --release
FROM chef as auth-builder
COPY . .
COPY --from=cacher /app/target target
ENV SQLX_OFFLINE true
ENV RUSTFLAGS --cfg tokio_unstable
RUN cargo build --bin azerust-auth --release
FROM chef as world-builder
COPY . .
COPY --from=cacher /app/target target
ENV SQLX_OFFLINE true
ENV RUSTFLAGS --cfg tokio_unstable
RUN cargo build --bin azerust-world --release
FROM scratch as auth
COPY --from=auth-builder /app/target/x86_64-unknown-linux-musl/release/azerust-auth /auth
CMD ["/auth"]
FROM scratch as world
COPY --from=world-builder /app/target/x86_64-unknown-linux-musl/release/azerust-world /world
CMD ["/world"]