From 3a4701b600ef8bb927a8846961aecbdbfa28b366 Mon Sep 17 00:00:00 2001 From: Austin Wells Date: Tue, 3 Feb 2026 16:46:41 -0500 Subject: [PATCH 1/3] Adding Docker support. --- servers/git/Dockerfile | 60 ++++++++++++++++++++++++++++++++++++++++ servers/git/compose.yaml | 6 ++++ 2 files changed, 66 insertions(+) create mode 100644 servers/git/Dockerfile create mode 100644 servers/git/compose.yaml diff --git a/servers/git/Dockerfile b/servers/git/Dockerfile new file mode 100644 index 0000000..66bb1c0 --- /dev/null +++ b/servers/git/Dockerfile @@ -0,0 +1,60 @@ +# syntax=docker/dockerfile:1 + +# Comments are provided throughout this file to help you get started. +# If you need more help, visit the Dockerfile reference guide at +# https://docs.docker.com/go/dockerfile-reference/ + +# Want to help us make this template better? Share your feedback here: https://forms.gle/ybq9Krt8jtBL3iCk7 + +ARG PYTHON_VERSION=3.10.12 +FROM python:${PYTHON_VERSION}-slim as base + +# Prevents Python from writing pyc files. +ENV PYTHONDONTWRITEBYTECODE=1 + +# Keeps Python from buffering stdout and stderr to avoid situations where +# the application crashes without emitting any logs due to buffering. +ENV PYTHONUNBUFFERED=1 + +WORKDIR /app + +# Install Git (Required for the Git Tool) +RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* + +# Create a non-privileged user that the app will run under. +# See https://docs.docker.com/go/dockerfile-user-best-practices/ +ARG UID=10001 +RUN adduser \ + --disabled-password \ + --gecos "" \ + --home "/nonexistent" \ + --shell "/sbin/nologin" \ + --no-create-home \ + --uid "${UID}" \ + appuser + +# Download dependencies as a separate step to take advantage of Docker's caching. +# Leverage a cache mount to /root/.cache/pip to speed up subsequent builds. +# Leverage a bind mount to requirements.txt to avoid having to copy them into +# into this layer. +RUN --mount=type=cache,target=/root/.cache/pip \ + --mount=type=bind,source=requirements.txt,target=requirements.txt \ + python -m pip install -r requirements.txt + +# Git needs a writable home for global config lookups, or it may crash +ENV HOME=/tmp + +# Copy the source code into the container. +COPY . . + +# Ensure the appuser owns the application code +RUN chown -R appuser:appuser /app + +# Switch to the non-privileged user to run the application. +USER appuser + +# Expose the port that the application listens on. +EXPOSE 8000 + +# Run the application. +CMD uvicorn 'main:app' --host=0.0.0.0 --port=8000 diff --git a/servers/git/compose.yaml b/servers/git/compose.yaml new file mode 100644 index 0000000..d1349f6 --- /dev/null +++ b/servers/git/compose.yaml @@ -0,0 +1,6 @@ +services: + server: + build: + context: . + ports: + - "8000:8000" From 1302baf229c1d72876ad20abd7d082078f659395 Mon Sep 17 00:00:00 2001 From: Austin Wells Date: Tue, 3 Feb 2026 16:48:10 -0500 Subject: [PATCH 2/3] Add GitPython to requirements --- servers/git/requirements.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/servers/git/requirements.txt b/servers/git/requirements.txt index b08d10d..573ffff 100644 --- a/servers/git/requirements.txt +++ b/servers/git/requirements.txt @@ -4,4 +4,6 @@ pydantic python-multipart pytz -python-dateutil \ No newline at end of file +python-dateutil + +GitPython From 3a01ad2681f3ad02b8ac48727156a4c44a4a5eff Mon Sep 17 00:00:00 2001 From: Austin Wells Date: Tue, 3 Feb 2026 17:00:05 -0500 Subject: [PATCH 3/3] Create .dockerignore to manage Docker build context Add .dockerignore file to exclude unnecessary files from Docker context --- servers/git/.dockerignore | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 servers/git/.dockerignore diff --git a/servers/git/.dockerignore b/servers/git/.dockerignore new file mode 100644 index 0000000..03a268b --- /dev/null +++ b/servers/git/.dockerignore @@ -0,0 +1,34 @@ +# Include any files or directories that you don't want to be copied to your +# container here (e.g., local build artifacts, temporary files, etc.). +# +# For more help, visit the .dockerignore file reference guide at +# https://docs.docker.com/go/build-context-dockerignore/ + +**/.DS_Store +**/__pycache__ +**/.venv +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/bin +**/charts +**/docker-compose* +**/compose.y*ml +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md