diff options
author | Elizabeth Hunt <me@liz.coffee> | 2025-07-28 23:20:17 -0700 |
---|---|---|
committer | Elizabeth Hunt <me@liz.coffee> | 2025-07-28 23:20:17 -0700 |
commit | 2573dbcee9249a6e9301dd0d7fd9e0b893b2ab2f (patch) | |
tree | 9424bfaeea771172db394bc681b8bb946d3c7795 /Dockerfile | |
download | wwwgit-2573dbcee9249a6e9301dd0d7fd9e0b893b2ab2f.tar.gz wwwgit-2573dbcee9249a6e9301dd0d7fd9e0b893b2ab2f.zip |
Init :3
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2d73b0a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,64 @@ +FROM debian:stable-slim AS build_stage + +ARG CGIT_VERSION="master" + +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + git \ + liblua5.1-dev \ + zlib1g-dev \ + libssl-dev \ + gettext \ + python3 \ + python3-docutils \ + python3-markdown \ + python3-pygments \ + ca-certificates \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /opt +RUN git clone https://git.zx2c4.com/cgit +WORKDIR /opt/cgit +RUN git checkout ${CGIT_VERSION} \ + && git submodule init \ + && git submodule update + +COPY cgit.conf . + +RUN make -j7 && make install + +FROM debian:stable-slim AS wwwgit + +RUN apt-get update && apt-get install -y --no-install-recommends \ + nginx-light \ + fcgiwrap \ + git \ + gettext-base \ + python3 \ + python3-docutils \ + python3-markdown \ + python3-pygments \ + tini \ + && rm -rf /var/lib/apt/lists/* + +COPY --from=build_stage /var/www/html/cgit /var/www/html/cgit + +RUN mkdir -p /var/lib/git/repositories \ + && chown -R www-data:www-data /var/www/html/cgit \ + && chown -R www-data:www-data /var/lib/git + +RUN rm /etc/nginx/sites-enabled/default + +COPY cgit.nginx.conf /etc/nginx/sites-available/cgit.conf +RUN ln -s /etc/nginx/sites-available/cgit.conf /etc/nginx/sites-enabled/cgit.conf + +COPY cgitrc /var/www/html/cgit/cgitrc + +COPY entrypoint.sh /usr/local/bin/entrypoint.sh +RUN chmod +x /usr/local/bin/entrypoint.sh + +RUN mkdir /run/sock +RUN chown -R www-data:www-data /run/sock + +EXPOSE 80 +ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/entrypoint.sh"] |