diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-11-02 11:44:36 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-11-02 11:44:36 +0900 |
| commit | f47a2ded50f3367d0c7b0673a6c452a93c1a669f (patch) | |
| tree | 81d5189dd550b7f4f4fe9227029cb87c9a96f7a6 /services/repos/Dockerfile | |
| parent | 960fb725eff960720268aa1425ac8880377d638f (diff) | |
| download | nsfisis.dev-f47a2ded50f3367d0c7b0673a6c452a93c1a669f.tar.gz nsfisis.dev-f47a2ded50f3367d0c7b0673a6c452a93c1a669f.tar.zst nsfisis.dev-f47a2ded50f3367d0c7b0673a6c452a93c1a669f.zip | |
Diffstat (limited to 'services/repos/Dockerfile')
| -rw-r--r-- | services/repos/Dockerfile | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/services/repos/Dockerfile b/services/repos/Dockerfile new file mode 100644 index 00000000..2734a1ee --- /dev/null +++ b/services/repos/Dockerfile @@ -0,0 +1,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 |
