-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
54 lines (40 loc) · 1.43 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
ARG BUILD_PROFILE=release
ARG BUILD_TARGET=x86_64-unknown-linux-musl
FROM lukemathwalker/cargo-chef:latest AS chef
WORKDIR app
RUN apt-get update
RUN apt-get install musl-tools -y
ARG BUILD_TARGET
RUN rustup target add ${BUILD_TARGET}
FROM chef AS planner
COPY ./src ./src
COPY ./Cargo.toml ./Cargo.toml
COPY ./Cargo.lock ./Cargo.lock
COPY ./examples ./examples
COPY ./crates ./crates
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
# Build dependencies - this is the caching Docker layer!
ARG BUILD_PROFILE
ARG BUILD_TARGET
RUN cargo chef cook --profile ${BUILD_PROFILE} --target ${BUILD_TARGET} --recipe-path recipe.json
# Build application
COPY ./src ./src
COPY ./Cargo.toml ./Cargo.toml
COPY ./Cargo.lock ./Cargo.lock
COPY ./examples ./examples
COPY ./crates ./crates
RUN cargo build --profile ${BUILD_PROFILE} --target ${BUILD_TARGET}
FROM nikolaik/python-nodejs:python3.10-nodejs18
RUN apt-get update
RUN apt-get install -y vim sqlite3
RUN pip install web3 python-dotenv
WORKDIR /app
COPY --from=ghcr.io/ufoscout/docker-compose-wait:latest /wait /wait
ARG BUILD_PROFILE
ARG BUILD_TARGET
COPY --from=builder /app/target/${BUILD_TARGET}/${BUILD_PROFILE}/erc20_processor /bin/erc20_processor
COPY ./config-payments-test.toml ./config-payments.toml
COPY ./scenarios/ .
CMD ["sh", "-c", "/wait && /bin/erc20_processor"]