Initial Docker deployment setup

This commit is contained in:
kosmos committed 2026-08-24 22:29:37 +00:00
commit 94d729ec1a
11 files changed
+285

No files matched your search

+46
View File
@@ -0,0 +1,46 @@
# syntax=docker/dockerfile:1
FROM python:3.12-trixie AS builder
WORKDIR /build
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ccache \
gcc \
g++ \
libmariadb-dev \
make \
patchelf \
python3-dev \
&& rm -rf /var/lib/apt/lists/*
COPY upstream/HubBackend/requirements.txt upstream/HubBackend/makefile ./
COPY upstream/HubBackend/src ./src
COPY upstream/HubBackend/config_sample.json upstream/HubBackend/openapi.json ./
# The binaries are compiled from this checkout. BuildKit's cache keeps repeated
# Nuitka builds reasonably fast without putting build tools in the final image.
RUN --mount=type=cache,target=/root/.cache/pip \
--mount=type=cache,target=/root/.cache/ccache \
make install-python \
&& make -j"$(nproc)" build
FROM debian:trixie-slim AS runtime
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& groupadd --system --gid 10001 drivershub \
&& useradd --system --uid 10001 --gid drivershub --home-dir /app drivershub
WORKDIR /app
COPY --from=builder --chown=drivershub:drivershub /build/dist/ ./
COPY --chown=root:root docker/entrypoint.sh /usr/local/bin/drivershub-entrypoint
USER drivershub
EXPOSE 7777 8700
ENTRYPOINT ["drivershub-entrypoint"]
CMD ["drivershub", "--config", "/app/config/config.json", "--banner-service-url", "http://bannergen:8700/banner"]