-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIngest.Dockerfile
36 lines (34 loc) · 1.08 KB
/
Ingest.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
35
36
FROM rust:1.65-bullseye AS chef
RUN cargo install --version 0.1.55 cargo-chef
FROM chef AS planner
COPY nft_ingester /rust/nft_ingester/
WORKDIR /rust/nft_ingester
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
RUN apt-get update -y && \
apt-get install -y build-essential make git
COPY digital_asset_types /rust/digital_asset_types
WORKDIR /
RUN mkdir -p /rust/nft_ingester
WORKDIR /rust/nft_ingester
COPY --from=planner /rust/nft_ingester/recipe.json recipe.json
# Build dependencies - this is the caching Docker layer!
COPY nft_ingester/Cargo.toml .
COPY nft_ingester .
# Build application
RUN cargo build --release
FROM rust:1.65-slim-bullseye
ARG APP=/usr/src/app
RUN apt update \
&& apt install -y curl ca-certificates tzdata \
&& rm -rf /var/lib/apt/lists/*
ENV TZ=Etc/UTC \
APP_USER=appuser
RUN groupadd $APP_USER \
&& useradd -g $APP_USER $APP_USER \
&& mkdir -p ${APP}
COPY --from=builder /rust/nft_ingester/target/release/nft_ingester ${APP}
RUN chown -R $APP_USER:$APP_USER ${APP}
USER $APP_USER
WORKDIR ${APP}
CMD /usr/src/app/nft_ingester