app
service-kicad
Public Made by Adomby adom
Shared headless KiCad 10: DRC, ERC, SVG/Gerber/STEP export, Altium library conversion, symbol/footprint/3D-model lookup. Every Adom tool shells to this CLI instead of calling the HTTP API directly.
# Dockerfile for service-kicad — DEFAULT channel (KiCad 10).
# REFERENCE only; production uses the default-light image + deploy.sh.
# For the v9 fallback channel, see Dockerfile.v9.
FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
software-properties-common curl build-essential pkg-config git jq cron \
&& add-apt-repository -y ppa:kicad/kicad-10.0-releases \
&& apt-get update \
&& apt-get install -y kicad kicad-symbols kicad-footprints kicad-packages3d \
&& rm -rf /var/lib/apt/lists/*
# Library overlay: prefer the upstream `10.0` stable branch when it
# exists, fall back to master. Same rationale as Dockerfile (the apt
# library packages lag upstream by years; the v10 stable branch is the
# closest matched pair to the v10 kicad-cli we just installed).
RUN for repo in kicad-footprints kicad-symbols kicad-packages3D; do \
dst="/opt/${repo,,}-upstream"; \
git clone --depth 1 --branch 10.0 "https://github.com/KiCad/$repo.git" "$dst" 2>/dev/null \
|| git clone --depth 1 "https://github.com/KiCad/$repo.git" "$dst"; \
done
ENV KICAD_FOOTPRINTS_DIR=/opt/kicad-footprints-upstream
ENV KICAD_SYMBOLS_DIR=/opt/kicad-symbols-upstream
ENV KICAD_PACKAGES3D_DIR=/opt/kicad-packages3d-upstream
# Weekly pull keeps the libraries current; logs to /var/log/kicad-lib-pull.log.
RUN echo '0 4 * * 1 root for d in /opt/kicad-footprints-upstream /opt/kicad-symbols-upstream /opt/kicad-packages3d-upstream; do git -C "$d" pull --quiet --ff-only 2>&1 | tee -a /var/log/kicad-lib-pull.log; done' > /etc/cron.d/kicad-lib-pull \
&& chmod 0644 /etc/cron.d/kicad-lib-pull
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
WORKDIR /app
COPY . .
RUN cd api && cargo build --release \
&& install target/release/service-kicad /usr/local/bin/service-kicad
EXPOSE 8780
CMD ["/usr/local/bin/service-kicad"]