blob: 2734a1eed461d08cb389fa229453d8edf9ef716d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
ARG BASE_DEBIAN_VERSION=trixie
ARG APACHE_HTTPD_VERSION=2.4.65
# NOTE: Use the master branch because the latest release is 6 years ago.
ARG CGIT_VERSION=master
################################################
FROM debian:$BASE_DEBIAN_VERSION-slim AS builder
################################################
ARG CGIT_VERSION
RUN apt-get update && \
apt-get install -y \
build-essential \
curl \
git \
libssl-dev \
zlib1g-dev
RUN git clone --branch $CGIT_VERSION https://git.zx2c4.com/cgit /cgit
WORKDIR /cgit
RUN --mount=type=bind,source=./cgit.conf,target=./cgit.conf \
make get-git && \
make NO_LUA=1 && \
make install
#####################################################
FROM httpd:$APACHE_HTTPD_VERSION-$BASE_DEBIAN_VERSION
#####################################################
COPY --from=builder /var/www/htdocs/cgit/ /usr/local/apache2/htdocs/cgit
RUN apt-get update && \
apt-get install -y \
zstd && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN sed -i \
-e 's/^\(\s*\)#\(LoadModule .*mod_cgid.so\)/\1\2/' \
-e 's/^\(\s*\)#\(LoadModule .*mod_cgi.so\)/\1\2/' \
/usr/local/apache2/conf/httpd.conf && \
echo 'Include conf/extra/httpd-cgit.conf' >> /usr/local/apache2/conf/httpd.conf
RUN ln -s /usr/local/apache2/conf/mime.types /etc/mime.types && \
mkdir -p /var/cache/cgit && \
chown -R www-data:www-data /var/cache/cgit
|