FROM nginx:stable-alpine # CGit ENV CGIT_VERSION=1.2.3-r5 # CGit default options ENV CGIT_TITLE="CGit" ENV CGIT_DESC="The hyperfast web frontend for Git repositories" ENV CGIT_VROOT="/" ENV CGIT_SECTION_FROM_STARTPATH=0 ENV CGIT_MAX_REPO_COUNT=50 RUN set -eux \ && apk add --no-cache \ ca-certificates \ cgit=${CGIT_VERSION} \ fcgiwrap \ git \ git-daemon \ lua5.3-libs \ py3-markdown \ py3-pygments \ py3-docutils \ groff \ python3 \ spawn-fcgi \ tzdata \ xz \ zlib \ && rm -rf /var/cache/apk/* \ && rm -rf /tmp/* \ && true COPY cgit/cgit.conf /tmp/cgitrc.tmpl COPY docker-entrypoint.sh / COPY nginx/nginx.conf /etc/nginx/nginx.conf COPY nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf RUN set -eux \ && echo "Creating application directories..." \ && mkdir -p /var/cache/cgit \ && mkdir -p /srv/git \ && true RUN set -eux \ && echo "Testing Nginx server configuration files..." \ && nginx -c /etc/nginx/nginx.conf -t \ && true ENTRYPOINT [ "/docker-entrypoint.sh" ] EXPOSE 80 STOPSIGNAL SIGQUIT CMD [ "nginx", "-g", "daemon off;" ]