Added git server and prometheus metrics

This commit is contained in:
2026-02-23 18:43:16 -05:00
parent 43d704a690
commit 09487d9a1f
11 changed files with 754 additions and 10 deletions

36
gitserver.Dockerfile Normal file
View File

@@ -0,0 +1,36 @@
# Use an official Debian base image
FROM debian:stable-slim
# Set environment variables to avoid prompts during installation
ENV DEBIAN_FRONTEND=noninteractive
# Install required packages
RUN apt-get update && \
apt-get install -y \
git \
openssh-server \
&& rm -rf /var/lib/apt/lists/*
# Create a new user (replace 'git' with your desired username)
RUN useradd -m -s /usr/bin/git-shell git && \
mkdir -p /home/git/.ssh && \
chown -R git:git /home/git/.ssh
# Set up SSH
# COPY sshd_config /etc/ssh/sshd_config
RUN echo "PermitRootLogin no" >> /etc/ssh/sshd_config && \
echo "PasswordAuthentication no" >> /etc/ssh/sshd_config && \
echo "ChallengeResponseAuthentication no" && \
echo "UsePAM no" >> /etc/ssh/sshd_config && \
echo "Subsystem git /usr/lib/git-core/git-shell"
# Expose SSH port
EXPOSE 22
RUN ln -sf /home/git/data/archive /archive
COPY gitserver.entrypoint.sh /entrypoint.sh
# Start SSH server
CMD ["/bin/bash", "/entrypoint.sh"]