-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (29 loc) · 1 KB
/
Dockerfile
File metadata and controls
37 lines (29 loc) · 1 KB
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
FROM debian:bullseye-slim
# Install git + nginx + fcgiwrap
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git nginx fcgiwrap spawn-fcgi && \
rm -rf /var/lib/apt/lists/*
# Create bare repo
RUN mkdir -p /srv/git && \
cd /srv/git && \
git init --bare myproject.git && \
touch myproject.git/git-daemon-export-ok
# Add self-signed cerrificate
RUN apt-get update && apt-get install -y openssl && \
mkdir -p /etc/nginx/ssl && \
openssl req -newkey rsa:2048 -nodes \
-keyout /etc/nginx/ssl/git.key \
-x509 -days 365 \
-out /etc/nginx/ssl/git.crt \
-subj "/CN=localhost"
# allow git-http-backend to accept pushes
RUN git config --system http.receivepack true
# Put nginx config in place
COPY nginx.conf /etc/nginx/sites-enabled/default
# Entrypoint will start fcgiwrap + nginx
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
WORKDIR /srv/git
EXPOSE 80
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]