-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
54 lines (38 loc) · 1.03 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
#Run from project root path:
# docker build -f Dockerfile -t local/eth-indexer .
FROM ubuntu:22.04 as builder
RUN apt-get update \
&& apt-get install -y \
curl \
build-essential \
llvm \
clang \
libudev-dev \
libssl-dev \
cmake \
dnsutils \
pkg-config \
protobuf-compiler
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH=$PATH:/root/.cargo/bin
RUN rustup default stable
RUN rustup update
RUN rustup update nightly
RUN rustup override set nightly-2023-04-05
COPY . /eth-indexer
WORKDIR /eth-indexer
RUN cargo build --release
FROM ubuntu:22.04 AS runner
RUN apt-get update \
&& apt-get install -y \
ca-certificates
RUN mkdir /eth-indexer
WORKDIR /eth-indexer
COPY --from=builder /eth-indexer/target/release/eth-indexer ./eth-indexer
COPY --from=builder /eth-indexer/.env.production ./.env.production
# 9615 for Prometheus (metrics)
# TODO: Add prometheus metrics support
EXPOSE 9615
ENV ETH_INDEXER=production
RUN ./eth-indexer --help
CMD [ "./eth-indexer index_live" ]