Dockerfile
browsing at commit = 5241fe95285e7a1c623c7bb6bfcc7f15a7e31330
# Multi git frontend.
#
# CppCMS is not packaged in Ubuntu, so the build stage compiles it from source
# (matching the 2.x series). The runtime stage carries only the shared
# libraries and the application.
FROM ubuntu:24.04 AS build
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
pkg-config \
git \
ca-certificates \
python3 \
python-is-python3 \
libpcre3-dev \
zlib1g-dev \
libssl-dev \
libicu-dev \
libgit2-dev \
&& rm -rf /var/lib/apt/lists/*
# Build and install CppCMS (provides libcppcms, libbooster and cppcms_tmpl_cc).
RUN git clone --depth 1 --recurse-submodules \
https://github.com/artyom-beilis/cppcms /tmp/cppcms \
&& cmake -S /tmp/cppcms -B /tmp/cppcms/build \
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local \
&& cmake --build /tmp/cppcms/build -j"$(nproc)" \
&& cmake --install /tmp/cppcms/build \
&& ldconfig
WORKDIR /src
COPY . /src
RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
&& cmake --build build -j"$(nproc)"
FROM ubuntu:24.04 AS runtime
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
libpcre3 \
zlib1g \
libssl3 \
libicu74 \
libgit2-1.7 \
git \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /usr/local/lib/libcppcms.so* /usr/local/lib/
COPY --from=build /usr/local/lib/libbooster.so* /usr/local/lib/
RUN ldconfig
COPY --from=build /src/build/sago_web_git /app/sago_web_git
COPY --from=build /src/static /app/static
COPY --from=build /src/config.json /app/config.json
WORKDIR /app
# Mount a directory of git repositories here.
ENV GIT_ROOT=/srv/git
VOLUME ["/srv/git"]
# Generated tag archives are cached here; mount a volume to persist them.
ENV GIT_CACHE_ROOT=/var/cache/sago_web_git
VOLUME ["/var/cache/sago_web_git"]
EXPOSE 11000
CMD ["/app/sago_web_git", "-c", "/app/config.json"]