forked from holaplex/indexer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
70 lines (50 loc) · 1.65 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
FROM rust:1.58.1-slim-bullseye AS build
WORKDIR /metaplex-indexer
RUN apt-get update -y && \
apt-get install -y \
libpq-dev \
libssl-dev \
libudev-dev \
pkg-config \
&& \
rm -rf /var/lib/apt/lists/*
COPY rust-toolchain.toml ./
# Force rustup to install toolchain
RUN rustc --version
COPY crates crates
COPY Cargo.toml Cargo.lock ./
RUN cargo build --profile docker \
--features " \
metaplex-indexer/accountsdb, \
metaplex-indexer/http \
" \
--bin metaplex-indexer-accountsdb \
--bin metaplex-indexer-http \
--bin metaplex-indexer-legacy-storefronts \
--bin metaplex-indexer-graphql
COPY scripts scripts
RUN scripts/strip-bins.sh target/docker bin
FROM debian:bullseye-slim AS base
WORKDIR /metaplex-indexer
RUN apt-get update -y && \
apt-get install -y \
ca-certificates \
libpq5 \
libssl1.1 \
&& \
rm -rf /var/lib/apt/lists/*
RUN mkdir -p bin
COPY .env .env.prod ./
CMD ["./startup.sh"]
FROM base AS accountsdb-consumer
COPY --from=build metaplex-indexer/bin/metaplex-indexer-accountsdb bin/
COPY --from=build metaplex-indexer/scripts/docker/accountsdb-consumer.sh startup.sh
FROM base AS http-consumer
COPY --from=build metaplex-indexer/bin/metaplex-indexer-http bin/
COPY --from=build metaplex-indexer/scripts/docker/http-consumer.sh startup.sh
FROM base AS legacy-storefronts
COPY --from=build metaplex-indexer/bin/metaplex-indexer-legacy-storefronts bin/
COPY --from=build metaplex-indexer/scripts/docker/legacy-storefronts.sh startup.sh
FROM base AS graphql
COPY --from=build metaplex-indexer/bin/metaplex-indexer-graphql bin/
COPY --from=build metaplex-indexer/scripts/docker/graphql.sh startup.sh