-
Notifications
You must be signed in to change notification settings - Fork 16
/
Dockerfile
27 lines (20 loc) · 897 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
FROM golang:1.20-bullseye AS builder
WORKDIR /usr/src/ipfs-crawler/
# Download all dependencies first, this should be cached.
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN go build -v -o ipfs-crawler cmd/ipfs-crawler/main.go
FROM debian:bullseye-slim AS runner
# Enter our working directory.
WORKDIR libp2p-crawler
# Copy compiled binaries from builder.
COPY --from=builder /usr/src/ipfs-crawler/ipfs-crawler ./libp2p-crawler
COPY --from=builder /usr/src/ipfs-crawler/dist/docker_entrypoint.sh .
COPY --from=builder /usr/src/ipfs-crawler/dist/config_ipfs.yaml ./config/config_ipfs.yaml
COPY --from=builder /usr/src/ipfs-crawler/dist/config_filecoin_mainnet.yaml ./config/config_filecoin_mainnet.yaml
# Link IPFS config to be executed by default
RUN ln -s ./config/config_ipfs.yaml config.yaml
# Run the binary.
ENTRYPOINT ["./docker_entrypoint.sh", "--config", "config.yaml"]