-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile.refresher
34 lines (30 loc) · 1017 Bytes
/
Dockerfile.refresher
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
ARG DETECTIVE_URL
ARG DATABASE_URL
ARG ALCHEMY_NODE_URL
FROM lukemathwalker/cargo-chef:latest AS chef
FROM chef AS planner
# WORKDIR /app
# COPY /apps/refresher apps/refresher/
# COPY /packages/database packages/database/
# WORKDIR /app/apps/refresher
# RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
# COPY --from=planner /app/apps/refresher/recipe.json recipe.json
# # Build dependencies - this is the caching Docker layer!
# RUN cargo chef cook --release --recipe-path recipe.json
# # Build application
WORKDIR /app
COPY /apps/refresher apps/refresher/
COPY /packages/database packages/database/
WORKDIR /app/apps/refresher
RUN rm -f ./src/prisma.rs
RUN rustup component add rustfmt
RUN cargo generate
RUN cargo fmt
RUN cargo build --release --bin refresher
FROM debian:bookworm-slim AS runtime
RUN apt update
RUN apt install openssl ca-certificates -y
WORKDIR /app
COPY --from=builder /app/apps/refresher/target/release/refresher /usr/local/bin
ENTRYPOINT ["/usr/local/bin/refresher"]