FROM debian:jessie # Setup Container VOLUME ["/repos"] EXPOSE 80 # Setup APT RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections # Update, Install Prerequisites, Clean Up APT RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && \ apt-get -y install git wget nginx-full fcgiwrap && \ apt-get clean # Setup Container User RUN useradd -M -s /bin/false git --uid 1000 # Setup nginx fcgi services to run as user git, group git RUN sed -i 's/FCGI_USER="www-data"/FCGI_USER="git"/g' /etc/init.d/fcgiwrap && \ sed -i 's/FCGI_GROUP="www-data"/FCGI_GROUP="git"/g' /etc/init.d/fcgiwrap && \ sed -i 's/FCGI_SOCKET_OWNER="www-data"/FCGI_SOCKET_OWNER="git"/g' /etc/init.d/fcgiwrap && \ sed -i 's/FCGI_SOCKET_GROUP="www-data"/FCGI_SOCKET_GROUP="git"/g' /etc/init.d/fcgiwrap # Create config files for container startup and nginx COPY nginx.conf /etc/nginx/nginx.conf # Create pre-receive COPY dehub /usr/bin/dehub COPY "pre-receive" /pre-receive # Create start.sh COPY start.sh /start.sh RUN chmod +x /start.sh ENTRYPOINT ["/start.sh"]