Dockerfile 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Local dev backend: smartbotic-database + smartbotic-vectorapi from the release
  2. # .debs. Native builds are impossible on the Void dev host (protobuf 35 removed
  3. # a header the generated protos need), so the Debian 13 image is the only way to
  4. # run the real stack locally. The web UI is served by Vite in dev, not from here.
  5. #
  6. # The versions are ARGs and are ASSERTED rather than assumed: fetch-debs.sh
  7. # stages exactly the ones named, and the RUN below fails the build if any is
  8. # missing. Installing whatever happens to be in debs/ is how a "prod-faithful"
  9. # image quietly stops being faithful.
  10. FROM debian:13
  11. ARG DB_VERSION
  12. ARG DB_CLIENT_VERSION
  13. ARG VAPI_VERSION
  14. # adduser is needed by both postinst scripts; systemctl is not present in a
  15. # container, so a no-op shim lets the packages configure cleanly. The services
  16. # are started by the entrypoint instead. libidn2-0 is a real NEEDED library of
  17. # the runner's vendored curl; jq and procps are for measuring from inside.
  18. RUN apt-get update && apt-get install -y --no-install-recommends \
  19. ca-certificates curl adduser libidn2-0 jq procps \
  20. && rm -rf /var/lib/apt/lists/* \
  21. && printf '#!/bin/sh\nexit 0\n' > /usr/bin/systemctl && chmod +x /usr/bin/systemctl
  22. COPY debs/ /tmp/debs/
  23. RUN set -e; \
  24. if [ -n "$DB_VERSION" ]; then \
  25. for f in smartbotic-database_${DB_VERSION}_amd64.deb \
  26. libsmartbotic-db-client_${DB_CLIENT_VERSION}_amd64.deb \
  27. smartbotic-vectorapi_${VAPI_VERSION}_amd64.deb; do \
  28. [ -f "/tmp/debs/$f" ] || { echo "expected deb missing from build context: $f" >&2; exit 1; }; \
  29. done; \
  30. fi; \
  31. apt-get update && apt-get install -y --no-install-recommends /tmp/debs/*.deb \
  32. && rm -rf /var/lib/apt/lists/* /tmp/debs
  33. COPY entrypoint.sh /usr/local/bin/entrypoint.sh
  34. RUN chmod +x /usr/local/bin/entrypoint.sh
  35. EXPOSE 8080
  36. ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]