📄 entrypoint.sh
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/bin/bash
set -e

# Create directory for the socket
mkdir -p /var/run/fcgiwrap
chown git:git /var/run/fcgiwrap

# Start fcgiwrap as git user
spawn-fcgi -s /var/run/fcgiwrap/fcgiwrap.socket -U nginx -u git -g git -- /usr/sbin/fcgiwrap

# Make sure nginx can access the socket
chmod 660 /var/run/fcgiwrap/fcgiwrap.socket

# Start nginx in foreground
exec nginx -g 'daemon off;'