forked from graphprotocol/indexer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.indexer-agent
63 lines (44 loc) · 1.87 KB
/
Dockerfile.indexer-agent
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
########################################################################
# Build image
FROM node:12.16.0-slim as build
ENV NODE_ENV production
RUN apt-get update && apt-get install -y python build-essential git curl
# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rustup.sh && sh /tmp/rustup.sh -y
ENV PATH="/root/.cargo/bin:$PATH"
WORKDIR /opt/indexer
# Copy root files
COPY package.json .
COPY yarn.lock .
COPY tsconfig.json .
COPY lerna.json .
# Copy shared and package files
COPY packages/indexer-common/ ./packages/indexer-common
COPY packages/indexer-agent/ ./packages/indexer-agent
# Install dependencies; include dev dependencies
RUN yarn --frozen-lockfile --non-interactive --production=false
########################################################################
# Runtime image
FROM node:12.16.0-slim
ENV NODE_ENV production
RUN apt-get update && apt-get install -y python build-essential git curl
# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rustup.sh && sh /tmp/rustup.sh -y
ENV PATH="/root/.cargo/bin:$PATH"
WORKDIR /opt/indexer
# Copy root files
COPY package.json .
COPY yarn.lock .
COPY tsconfig.json .
COPY lerna.json .
# Copy build output
COPY --from=build /opt/indexer/packages/indexer-common/package.json /opt/indexer/packages/indexer-common/package.json
COPY --from=build /opt/indexer/packages/indexer-common/dist /opt/indexer/packages/indexer-common/dist
COPY --from=build /opt/indexer/packages/indexer-agent/package.json /opt/indexer/packages/indexer-agent/package.json
COPY --from=build /opt/indexer/packages/indexer-agent/dist /opt/indexer/packages/indexer-agent/dist
# Install dependencies; exclude dev dependencies
RUN yarn --frozen-lockfile --non-interactive
ENV ETHEREUM ""
# Run the indexer-agent
WORKDIR /opt/indexer/packages/indexer-agent
ENTRYPOINT ["node", "dist/index.js", "start"]