diff options
| author | Jose Quintana <[email protected]> | 2022-05-11 11:08:22 +0200 |
|---|---|---|
| committer | Jose Quintana <[email protected]> | 2022-05-11 11:08:22 +0200 |
| commit | b4850173260c9f5f648955726ce62c9dc157e982 (patch) | |
| tree | e77c746c47f6355c49dac8c44f53dc8131ce2366 /Dockerfile | |
| parent | aed4f5bf7a4d06a1a7e365df55d951c3a20cd42b (diff) | |
| download | alpine-cgit-b4850173260c9f5f648955726ce62c9dc157e982.tar.xz alpine-cgit-b4850173260c9f5f648955726ce62c9dc157e982.zip | |
feat: custom configuration file support via `USE_CUSTOM_CONFIG` env
resolves #7
Diffstat (limited to 'Dockerfile')
| -rw-r--r-- | Dockerfile | 32 |
1 files changed, 22 insertions, 10 deletions
@@ -6,7 +6,9 @@ ENV VERSION=${VERSION} # CGit ARG CGIT_VERSION=1.2.3-r2 ENV CGIT_VERSION=${CGIT_VERSION} -ENV CGIT_TITLE="cgit" + +# 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 @@ -35,19 +37,29 @@ RUN set -eux \ && 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 -VOLUME [ "/srv/git", "/var/cache/cgit" ] +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;" ] -CMD chown nginx:nginx /var/cache/cgit \ - && chmod u+g /var/cache/cgit \ - && envsubst < /tmp/cgitrc.tmpl > /etc/cgitrc \ - && spawn-fcgi \ - -u nginx -g nginx \ - -s /var/run/fcgiwrap.sock \ - -n -- /usr/bin/fcgiwrap \ - & nginx -g "daemon off;" # Metadata LABEL org.opencontainers.image.vendor="Jose Quintana" \ |
