refactor: replace pdftoppm with go-fitz for in-process PDF rendering
Switch PDF page rendering from external pdftoppm/pdftocairo subprocess calls to github.com/gen2brain/go-fitz (MuPDF wrapper), eliminating the poppler-utils runtime dependency. Enable CGO in Dockerfile builder stage and install gcc/musl-dev for the static MuPDF link; runtime image remains unchanged.
This commit is contained in:
@@ -10,9 +10,10 @@ ENV GOPROXY=https://goproxy.cn,direct
|
||||
ENV GOSUMDB=off
|
||||
|
||||
|
||||
# Build binary
|
||||
RUN go mod download && \
|
||||
CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o doc_ai ./main.go
|
||||
# Build binary (CGO required for go-fitz/MuPDF)
|
||||
RUN apk add --no-cache gcc musl-dev && \
|
||||
go mod download && \
|
||||
CGO_ENABLED=1 GOOS=linux go build -ldflags="-s -w" -o doc_ai ./main.go
|
||||
|
||||
# Runtime stage
|
||||
FROM crpi-8s2ierii2xan4klg.cn-beijing.personal.cr.aliyuncs.com/texpixel/alpine:latest
|
||||
|
||||
Reference in New Issue
Block a user