Fixed compilation errors in integration code: Type System Fixes: - Add types.Logger type alias (*slog.Logger) - Add PoolInfo.LiquidityUSD field - Add ProtocolSushiSwap and ProtocolCamelot constants - Fix time.Now() call in arbiscan_validator.go Pool Discovery Fixes: - Change cache from *cache.PoolCache to cache.PoolCache (interface) - Add context.Context parameters to cache.Add() and cache.Count() calls - Fix protocol type from string to ProtocolType Docker Fixes: - Add .dockerignore to exclude test files and docs - Add go mod tidy step in Dockerfile - Add //go:build examples tag to example_usage.go Still Remaining: - Arbitrage package needs similar interface fixes - SwapEvent.TokenIn/TokenOut field name issues - More cache interface method calls need context Progress: Parser and pool discovery packages now compile correctly. Integration code (main.go, sequencer, pools) partially working. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
59 lines
1.2 KiB
Docker
59 lines
1.2 KiB
Docker
# Multi-stage build for MEV Bot V2
|
|
|
|
# Stage 1: Build
|
|
FROM golang:1.21-alpine AS builder
|
|
|
|
# Install build dependencies
|
|
RUN apk add --no-cache git make gcc musl-dev linux-headers
|
|
|
|
# Set working directory
|
|
WORKDIR /build
|
|
|
|
# Copy go mod files
|
|
COPY go.mod go.sum ./
|
|
|
|
# Download dependencies
|
|
RUN go mod download
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Update go.sum with all dependencies
|
|
RUN go mod tidy
|
|
|
|
# Build the application
|
|
RUN go build -o mev-bot-v2 -ldflags="-w -s" ./cmd/mev-bot-v2
|
|
|
|
# Stage 2: Runtime
|
|
FROM alpine:latest
|
|
|
|
# Install runtime dependencies
|
|
RUN apk add --no-cache ca-certificates tzdata
|
|
|
|
# Create non-root user
|
|
RUN addgroup -g 1000 mevbot && \
|
|
adduser -D -u 1000 -G mevbot mevbot
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy binary from builder
|
|
COPY --from=builder /build/mev-bot-v2 .
|
|
|
|
# Create directories
|
|
RUN mkdir -p /app/logs /app/data && \
|
|
chown -R mevbot:mevbot /app
|
|
|
|
# Switch to non-root user
|
|
USER mevbot
|
|
|
|
# Expose metrics port
|
|
EXPOSE 9090
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
|
CMD wget --no-verbose --tries=1 --spider http://localhost:9090/metrics || exit 1
|
|
|
|
# Run the application
|
|
ENTRYPOINT ["/app/mev-bot-v2"]
|