Something went wrong. Try again.
fork of gh:maxwoffard/pic-to-patch
Something went wrong. Try again.
pic-to-patch Dockerfile.worker
1.8 kB · 48 lines
at main
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849# Stage 1: build Go binaryFROM golang:1.26-alpine AS go-builderWORKDIR /srcCOPY worker/go.mod worker/go.sum ./RUN go mod downloadCOPY worker/*.go ./RUN CGO_ENABLED=0 go build -o /worker .
# Stage 2: build vtracer from Rust sourceFROM rust:1-slim AS rust-builderRUN cargo install vtracer
# Stage 3: download and strip inkstitchFROM debian:trixie-slim AS inkstitch-builderRUN apt-get update && apt-get install -y --no-install-recommends \ wget xz-utils ca-certificates \ && rm -rf /var/lib/apt/lists/*
ARG INKSTITCH_VERSION=3.2.2RUN ARCH=$(dpkg --print-architecture) && \ if [ "$ARCH" = "arm64" ]; then INKARCH="aarch64"; else INKARCH="x86_64"; fi && \ wget -q "https://github.com/inkstitch/inkstitch/releases/download/v${INKSTITCH_VERSION}/inkstitch-${INKSTITCH_VERSION}-linux-${INKARCH}.tar.xz" \ -O /tmp/inkstitch.tar.xz && \ mkdir -p /opt/inkstitch && \ tar xJf /tmp/inkstitch.tar.xz -C /opt/inkstitch && \ rm /tmp/inkstitch.tar.xz && \ rm -rf /opt/inkstitch/inkstitch/fonts \ /opt/inkstitch/inkstitch/bin/locales \ /opt/inkstitch/inkstitch/inx \ /opt/inkstitch/inkstitch/palettes \ /opt/inkstitch/inkstitch/tiles \ /opt/inkstitch/inkstitch/addons \ /opt/inkstitch/inkstitch/symbols \ /opt/inkstitch/inkstitch/dbus
# Stage 4: runtime (no Python!)FROM debian:trixie-slim
RUN apt-get update && apt-get install -y --no-install-recommends \ inkscape libwayland-cursor0 libdrm2 libgbm1 libxcb-dri3-0 \ && rm -rf /var/lib/apt/lists/*
COPY --from=go-builder /worker /usr/local/bin/workerCOPY --from=rust-builder /usr/local/cargo/bin/vtracer /usr/local/bin/vtracerCOPY --from=inkstitch-builder /opt/inkstitch /opt/inkstitchENV INKSTITCH_BIN=/opt/inkstitch/inkstitch/bin/inkstitch
CMD ["worker"]