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.v9 for service-kicad — V9 FALLBACK channel.
# REFERENCE only; production uses the default-light image + deploy-v9.sh.
# Most users want the default Dockerfile (KiCad 10).
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-9.0-releases \
&& apt-get update \
&& apt-get install -y kicad kicad-symbols kicad-footprints kicad-packages3d \
&& rm -rf /var/lib/apt/lists/*
# The Ubuntu apt packages of kicad-symbols/footprints/packages3d lag the
# upstream KiCad libraries by ~years (the 24.04 packages are ~2020 snapshot).
# Overlay the upstream github repos so users see the latest parts. Set the
# *_DIR env vars so service-kicad serves these instead of the apt copies.
# A cron job below refreshes them weekly.
RUN git clone --depth 1 https://github.com/KiCad/kicad-footprints.git /opt/kicad-footprints-upstream \
&& git clone --depth 1 https://github.com/KiCad/kicad-symbols.git /opt/kicad-symbols-upstream \
&& git clone --depth 1 https://github.com/KiCad/kicad-packages3D.git /opt/kicad-packages3d-upstream
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 cd /opt/kicad-footprints-upstream && git pull --quiet 2>&1 | tee -a /var/log/kicad-lib-pull.log; cd /opt/kicad-symbols-upstream && git pull --quiet 2>&1 | tee -a /var/log/kicad-lib-pull.log; cd /opt/kicad-packages3d-upstream && git pull --quiet 2>&1 | tee -a /var/log/kicad-lib-pull.log' > /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"]