Skip to content

Instantly share code, notes, and snippets.

@ran-dall
Created May 3, 2024 01:48
Show Gist options
  • Save ran-dall/f368772791a9093a2c4e66cfb026894f to your computer and use it in GitHub Desktop.
Save ran-dall/f368772791a9093a2c4e66cfb026894f to your computer and use it in GitHub Desktop.
This Docker container facilitates the use of gpt-repository-loader, a CLI tool that formats Git repositories for AI analysis.
# Use an official Python runtime as a parent image
FROM python:3.9-slim
# Install git
RUN apt-get update && \
apt-get install -y git && \
rm -rf /var/lib/apt/lists/*
# Set the working directory in the container
WORKDIR /usr/src/app
# Clone the gpt-repository-loader repository from GitHub
RUN git clone https://github.com/mpoon/gpt-repository-loader.git .
# Create a volume for the repository
VOLUME /usr/src/repo
# Set the entry point for the container
ENTRYPOINT ["python", "/usr/src/app/gpt_repository_loader.py"]
# Default command if no repository path is provided at runtime
CMD ["/usr/src/repo", "-o", "/usr/src/repo/output.txt"]
@ran-dall
Copy link
Author

ran-dall commented May 3, 2024

Just build (docker build -t gpt-repository-loader:latest .) mount your repository and start converting.

Example: docker run -v /path/to/your/repo:/usr/src/repo gpt-repository-loader

You should get an output.txt file added to your mounted repo and profit!

Shoutout to @mpoon for creating such an awesome tool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment