aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
blob: f291918cbfb98726634d5e3aa6b2ff20d8ca8b24 (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
FROM alpine:latest AS builder

COPY . /app

WORKDIR /app

RUN apk --no-cache add git && \
  git submodule update --init --recursive

RUN apk --no-cache add libc-dev git gcc make \
  openssl-dev libzip lua5.4-dev zlib-dev libcurl \
  musl-libintl gettext-static

RUN make NO_REGEX=NeedsStartEnd LUA_PKGCONFIG=lua5.4 -j$(nproc) install

FROM alpine:latest AS runtime

RUN apk --no-cache add lighttpd python3 lua5.4 py3-markdown py3-pygments highlight 

COPY --from=builder           /var/www/htdocs/cgit /usr/share/webapps/cgit
COPY ./source-code-pro/       /usr/share/webapps/cgit/
COPY ./about.html             /usr/share/webapps/cgit/about.html
COPY ./filters                /usr/lib/cgit/filters

COPY lighttpd.conf            /etc/lighttpd/lighttpd.conf
COPY cgitrc                   /etc/cgitrc
COPY cgitrepos                /etc/cgitrepos

RUN mkdir -p /var/cache/cgit && \
  chown -R lighttpd:lighttpd /var/cache/cgit && \
  mkdir -p /repositories && \
  chown -R lighttpd:lighttpd /repositories

HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
  CMD wget --no-verbose --tries=1 --spider http://127.0.0.1/ || exit 1

EXPOSE 80
ENTRYPOINT [ "lighttpd", "-D", "-f", "/etc/lighttpd/lighttpd.conf" ]