FROM alpine:latest AS builder COPY . /app WORKDIR /app RUN apk --no-cache add git && \ git submodule update --init --recursive RUN apk --no-cache add libc-dev git gcc make \ openssl-dev libzip lua5.4-dev zlib-dev libcurl \ musl-libintl gettext-static RUN make NO_REGEX=NeedsStartEnd LUA_PKGCONFIG=lua5.4 -j$(nproc) install FROM alpine:latest AS runtime RUN apk --no-cache add lighttpd python3 lua5.4 py3-markdown py3-pygments highlight 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 lighttpd:lighttpd /var/cache/cgit && \ mkdir -p /repositories && \ chown -R lighttpd:lighttpd /repositories HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \ CMD wget --no-verbose --tries=1 --spider http://127.0.0.1/ || exit 1 EXPOSE 80 ENTRYPOINT [ "lighttpd", "-D", "-f", "/etc/lighttpd/lighttpd.conf" ]