-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
61 lines (53 loc) · 2.24 KB
/
Dockerfile
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
FROM alpine:3.9
LABEL Maintainer="Craig Manley https://github.com/cmanley" \
Description="GitList (an elegant git repository viewer) using nginx, php-fpm 7.2, and Alpine Linux 3.9"
RUN apk update && apk --no-cache add \
git \
nginx \
php7 \
php7-ctype \
php7-fpm \
php7-json \
php7-mbstring \
php7-simplexml \
supervisor
### repository mount point and dummy repository ###
ARG REPOSITORY_ROOT=/repos
ARG REPOSITORY_DUMMY=$REPOSITORY_ROOT/If_you_see_this_then_the_host_volume_was_not_mounted
RUN mkdir -p "$REPOSITORY_DUMMY" \
&& git --bare init "$REPOSITORY_DUMMY"
### gitlist ####
ARG GITLIST_DOWNLOAD_FILENAME='gitlist-1.0.2.tar.gz'
ARG GITLIST_DOWNLOAD_URL="https://github.com/klaussilveira/gitlist/releases/download/1.0.2/$GITLIST_DOWNLOAD_FILENAME"
ARG GITLIST_DOWNLOAD_SHA256=38728b688f6600ad97b6d5900b472da6529ff7f3b8c0669ada25ae0bb65d34d9
RUN NEED='wget'; \
DEL='' \
&& for x in $NEED; do \
if [ $(apk list "$x" | grep -F [installed] | wc -l) -eq 0 ]; then \
DEL="$DEL $x" \
&& echo "Add temporary package $x" \
&& apk --no-cache add $x; \
fi; \
done \
&& cd /var/www \
&& wget -q "$GITLIST_DOWNLOAD_URL" -O "$GITLIST_DOWNLOAD_FILENAME" \
&& sha256sum "$GITLIST_DOWNLOAD_FILENAME" \
&& echo "$GITLIST_DOWNLOAD_SHA256 $GITLIST_DOWNLOAD_FILENAME" | sha256sum -c - \
&& tar -xf "$GITLIST_DOWNLOAD_FILENAME" \
&& rm "$GITLIST_DOWNLOAD_FILENAME" \
&& if [ -n "$DEL" ]; then echo "Delete temporary package(s) $DEL" && apk del $DEL; fi \
&& mkdir -p gitlist/cache \
&& chmod a+trwx gitlist/cache;
# Create an alternate bootstrap3 theme called bootstrap3-wide having 100% width instead of a limited set of 'adaptive' widths.
RUN cd /var/www/gitlist/themes \
&& cp -al bootstrap3 bootstrap3-wide \
&& rm bootstrap3-wide/css/style.css \
&& cp bootstrap3/css/style.css bootstrap3-wide/css/style.css \
&& sed -E -i -e 's/(@media ?\(min-width:[0-9]+px\)\{\.container\{width:[0-9]+px\}\})+/.container{width:100%}/' bootstrap3-wide/css/style.css \
&& rm bootstrap3-wide/twig/commits_list.twig \
&& cp bootstrap3/twig/commits_list.twig bootstrap3-wide/twig/commits_list.twig \
&& sed -i -e 's/date("F j, Y")/date("l, j F Y")/' bootstrap3-wide/twig/commits_list.twig
COPY copy /
EXPOSE 80
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["gitlist"]