mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-05-20 00:31:31 +00:00
- Remove github.com/pganalyze/pg_query_go/v6 dependency to avoid CGO requirement - Implement lightweight SQL parser for basic SELECT, SHOW, and DDL statements - Fix operator precedence in WHERE clause parsing (handle AND/OR before comparisons) - Support INTEGER, FLOAT, and STRING literals in WHERE conditions - All SQL engine tests passing with new parser - PostgreSQL integration tests can now build without CGO The lightweight parser handles the essential SQL features needed for the SeaweedFS query engine while maintaining compatibility and avoiding CGO dependencies that caused Docker build issues.
41 lines
871 B
Docker
41 lines
871 B
Docker
FROM golang:1.24-alpine AS builder
|
|
|
|
# Install git and other build dependencies
|
|
RUN apk add --no-cache git make
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy go mod files first for better caching
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Build the weed binary without CGO
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w" -o weed ./weed/
|
|
|
|
# Final stage - minimal runtime image
|
|
FROM alpine:latest
|
|
|
|
# Install ca-certificates for HTTPS calls and netcat for health checks
|
|
RUN apk --no-cache add ca-certificates netcat-openbsd curl
|
|
|
|
WORKDIR /root/
|
|
|
|
# Copy the weed binary from builder stage
|
|
COPY --from=builder /app/weed .
|
|
|
|
# Make it executable
|
|
RUN chmod +x ./weed
|
|
|
|
# Expose ports
|
|
EXPOSE 9333 8888 8333 8085 9533 5432
|
|
|
|
# Create data directory
|
|
RUN mkdir -p /data
|
|
|
|
# Default command (can be overridden)
|
|
CMD ["./weed", "server", "-dir=/data"]
|