FROM ubuntu:24.04 AS builder ENV DEBIAN_FRONTEND=noninteractive COPY . /app WORKDIR /app RUN apt-get update && \ apt-get install -y --no-install-recommends \ git ca-certificates pkg-config \ build-essential make gcc \ libssl-dev libzip-dev zlib1g-dev \ libcurl4-openssl-dev \ liblua5.4-dev \ gettext && \ git submodule update --init --recursive && \ rm -rf /var/lib/apt/lists/* RUN make NO_REGEX=NeedsStartEnd LUA_PKGCONFIG=lua5.4 -j"$(nproc)" install FROM ubuntu:24.04 AS runtime ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ apt-get install -y --no-install-recommends lighttpd lighttpd-mod-magnet liblua5.4-0 python3 highlight python3-markdown python3-pygments && \ rm -rf /var/lib/apt/lists/* COPY --from=builder /var/www/htdocs/cgit /usr/share/webapps/cgit COPY ./source-code-pro/ /usr/share/webapps/cgit/ COPY ./about.html /usr/share/webapps/cgit/about.html COPY ./filters /usr/lib/cgit/filters COPY lighttpd.conf /etc/lighttpd/lighttpd.conf COPY cgitrc /etc/cgitrc COPY cgitrepos /etc/cgitrepos RUN mkdir -p /var/cache/cgit && \ chown -R www-data:www-data /var/cache/cgit EXPOSE 80 ENTRYPOINT [ "lighttpd", "-D", "-f", "/etc/lighttpd/lighttpd.conf" ]