Sophia

Sophia / Simple git http server

Last active 1 week ago

Revision 5d02624bb176e252b9335ae90582ebbfe9cdea1e

Containerfile Raw
1# Located in app directory
2FROM docker.io/nginx:stable-alpine
3
4RUN apk add --no-cache git-daemon fcgiwrap spawn-fcgi
5
6COPY nginx.conf /etc/nginx/nginx.conf
7
8VOLUME ["/git"]
9
10EXPOSE 80
11
12CMD spawn-fcgi -s /run/fcgi.sock /usr/bin/fcgiwrap && \
13 nginx -g "daemon off;"
14
compose.yaml Raw
1# labels and networks are fairly specific to my Podman setup, so adjust as necessary
2services:
3 git-http-server:
4 build: ./app
5 volumes:
6 - ~/repos:/git
7 labels:
8 caddy: server.example.com
9 caddy.import: defaults
10 caddy.reverse_proxy: "{{upstreams 80}}"
11
12networks:
13 services:
14 external: true
15
nginx.conf Raw
1# Located in app directory
2user root;
3worker_processes 1;
4
5error_log /var/log/nginx/error.log warn;
6pid /var/run/nginx.pid;
7
8events {
9 worker_connections 1024;
10}
11
12http {
13 server {
14 listen *:80;
15
16 access_log /var/log/nginx/access.log;
17
18 location ~ (/.*) {
19 # Set chunks to unlimited, as the bodies can be huge
20 client_max_body_size 0;
21
22 include fastcgi_params;
23 fastcgi_param SCRIPT_FILENAME /usr/libexec/git-core/git-http-backend;
24 fastcgi_param GIT_PROJECT_ROOT /git;
25 fastcgi_param PATH_INFO $1;
26
27 fastcgi_pass unix:/run/fcgi.sock;
28 }
29 }
30}
31