forked from gifnksm/git-http-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
44 lines (36 loc) · 1.12 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
# syntax=docker/dockerfile:1
FROM rust:alpine AS builder
WORKDIR /usr/src/
RUN <<END
set -eux
apk --no-cache add \
musl-dev \
openssl-dev
END
RUN --mount=type=bind,target=/usr/src/git-http-server,source=.,rw \
--mount=type=cache,target=/usr/src/git-http-server/target \
--mount=type=cache,target=/usr/local/cargo/registry \
FROM nginx:alpine
RUN apk --no-cache --update upgrade && \
apk --no-cache add \
fcgiwrap \
highlight \
git \
git-daemon \
git-gitweb \
perl-cgi \
spawn-fcgi \
sudo \
&& \
adduser git -h /var/lib/git -D && \
adduser nginx git && \
git config --system http.receivepack true && \
git config --system http.uploadpack true && \
git config --system user.email "[email protected]" && \
git config --system user.name "Git Server"
COPY ./scripts/entrypoint.sh /git-http-server-entrypoint.sh
COPY ./etc/gitweb.conf /etc/gitweb.conf
COPY ./etc/nginx/conf.d/* /etc/nginx/conf.d/
COPY --from=builder /usr/local/cargo/bin/repomng /usr/local/bin/repomng
ENTRYPOINT ["/git-http-server-entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]