mirror of
https://github.com/luxfi/indexer.git
synced 2026-09-24 00:25:37 +00:00
fix(Dockerfile): drop legacy cmd/indexer build, build only cmd/explorer
cmd/indexer was kept around as the per-chain legacy entrypoint; cmd/explorer is now the unified single-binary entrypoint that subsumes it. The legacy build step was failing in CI because cmd/indexer hasn't been kept compiling through recent refactors. Drop it — the unified binary covers single-chain mode via --rpc as well as multi-chain via --config.
This commit is contained in:
+7
-5
@@ -6,16 +6,18 @@ COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
ARG VERSION=dev
|
||||
RUN mkdir -p cmd/explorer/static && \
|
||||
echo '<html><body>Indexer API — use luxfi/explorer for the frontend</body></html>' > cmd/explorer/static/index.html
|
||||
RUN CGO_ENABLED=1 CGO_CFLAGS="-D_LARGEFILE64_SOURCE" GOOS=linux go build \
|
||||
-ldflags="-s -w -X main.version=${VERSION}" -o /indexer ./cmd/indexer/
|
||||
# Ensure embedded static/ is non-empty (real Vite build copied in via COPY above).
|
||||
# If the build context did not include the SPA, fall back to a minimal placeholder
|
||||
# so go:embed succeeds. Real builds ship the full SPA from cmd/explorer/static/.
|
||||
RUN test -s cmd/explorer/static/index.html || ( \
|
||||
mkdir -p cmd/explorer/static && \
|
||||
echo '<html><body>Explorer placeholder — SPA not built. Run vite build before docker build.</body></html>' > cmd/explorer/static/index.html \
|
||||
)
|
||||
RUN CGO_ENABLED=1 CGO_CFLAGS="-D_LARGEFILE64_SOURCE" GOOS=linux go build \
|
||||
-ldflags="-s -w -X main.version=${VERSION}" -o /explorer ./cmd/explorer/
|
||||
|
||||
FROM alpine:3.21
|
||||
RUN apk add --no-cache ca-certificates sqlite-libs
|
||||
COPY --from=builder /indexer /usr/local/bin/indexer
|
||||
COPY --from=builder /explorer /usr/local/bin/explorer
|
||||
RUN adduser -D -u 65532 explorer
|
||||
USER explorer
|
||||
|
||||
Reference in New Issue
Block a user