File tree 3 files changed +26
-6
lines changed
3 files changed +26
-6
lines changed Original file line number Diff line number Diff line change
1
+ # git + GitHub stuff
2
+ .git *
3
+ * .yml
4
+
5
+ # Markdown
6
+ README.md
7
+ LICENSE.md
8
+
9
+ Dockerfile *
10
+ Makefile
Original file line number Diff line number Diff line change 2
2
# Stage 1: Build
3
3
# ===============
4
4
5
- FROM golang:1.21 -alpine as builder
5
+ FROM golang:1.22 -alpine AS builder
6
6
7
- COPY . /app
7
+ WORKDIR /src
8
8
9
- WORKDIR /app
9
+ RUN --mount=type=cache,target=/go/pkg/mod/ \
10
+ --mount=type=cache,target=/root/.cache/go-build \
11
+ --mount=type=bind,source=go.sum,target=go.sum \
12
+ --mount=type=bind,source=go.mod,target=go.mod \
13
+ go mod download -x
10
14
11
- RUN go build -o indexer ./cmd
15
+ ENV CGO_ENABLED=0 GOOS=linux
16
+
17
+ RUN --mount=type=cache,target=/go/pkg/mod/ \
18
+ --mount=type=cache,target=/root/.cache/go-build \
19
+ --mount=type=bind,target=. \
20
+ go build -o /app/indexer ./cmd
12
21
13
22
# ===============
14
23
# Stage 2: Run
15
24
# ===============
16
25
17
- FROM alpine
26
+ FROM alpine:3.20 AS tx-indexer
18
27
19
28
COPY --from=builder /app/indexer /usr/local/bin/indexer
20
-
21
29
ENTRYPOINT [ "/usr/local/bin/indexer" ]
Original file line number Diff line number Diff line change
1
+ # This Dockerfile is only useful for Goreleaser task
2
+ # https://goreleaser.com/customization/docker/
1
3
FROM scratch
2
4
COPY tx-indexer /
3
5
ENTRYPOINT [ "/tx-indexer" ]
You can’t perform that action at this time.
0 commit comments