-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
29 lines (19 loc) · 893 Bytes
/
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
ARG INDEXER_SERVICE_TAG=latest
FROM golang:1.18-bullseye as build
WORKDIR /root/app
COPY . .
RUN go build -buildvcs=false -ldflags="-s -w" -o autoagora-indexer-service ./src
########################################################################################
FROM ghcr.io/graphprotocol/indexer-service:${INDEXER_SERVICE_TAG}
# Upgrade everything:
RUN apt-get -y update && apt-get -y upgrade
# Create a privilege drop user:
RUN groupadd -r indexer && useradd -r -m -s /bin/bash -d /var/lib/indexer -c 'Indexer Service' -g indexer indexer
RUN chown -R indexer:indexer /var/lib/indexer
WORKDIR /opt/autoagora/bin
COPY --from=build /root/app/autoagora-indexer-service /opt/autoagora/bin/
USER indexer:indexer
ENV PATH=/opt/autoagora/bin:$PATH
ENV INDEXER_SERVICE_QUERY_TIMING_LOGS=true
# Run the indexer-service through the AutoAgora wrapper
ENTRYPOINT ["autoagora-indexer-service"]