forked from Cogwheel-Validator/spectra-gnoland-indexer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (21 loc) · 753 Bytes
/
Copy pathDockerfile
File metadata and controls
31 lines (21 loc) · 753 Bytes
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
FROM golang:1.25 AS builder
WORKDIR /app
COPY . .
ARG GIT_COMMIT=""
ARG GIT_TAG=""
ARG GIT_BRANCH=""
ARG VERSION=""
RUN if [ -z "$VERSION" ]; then \
if [ -n "$GIT_TAG" ]; then VERSION="$GIT_TAG"; \
else VERSION="${GIT_BRANCH}-${GIT_COMMIT}"; \
fi; \
fi && \
go build -ldflags="-s -w -X 'github.com/Cogwheel-Validator/spectra-gnoland-indexer/indexer/cmd.Commit=${GIT_COMMIT}' -X 'github.com/Cogwheel-Validator/spectra-gnoland-indexer/indexer/cmd.Version=${VERSION}'" -o indexer ./indexer
RUN chmod +x indexer
RUN touch config.yml
FROM gcr.io/distroless/base-debian13:latest
WORKDIR /app
COPY --from=builder /app/indexer .
COPY --from=builder --chown=nonroot:nonroot /app/config.yml .
USER nonroot
ENTRYPOINT ["/app/indexer"]