From 2759fd3640f066b11f658ac0aa2865d3d4dcde08 Mon Sep 17 00:00:00 2001 From: Alden Do Rosario Date: Mon, 9 Dec 2024 12:09:01 -0500 Subject: [PATCH] Added localized dockerized build instructions with documentation --- DOCKER.md | 27 +++++++++++++++++++++++++++ Dockerfile | 13 +++++++++++++ docker-compose.yaml | 10 ++++++++++ 3 files changed, 50 insertions(+) create mode 100644 DOCKER.md create mode 100644 Dockerfile create mode 100644 docker-compose.yaml diff --git a/DOCKER.md b/DOCKER.md new file mode 100644 index 0000000..a46a36d --- /dev/null +++ b/DOCKER.md @@ -0,0 +1,27 @@ +# Docker Usage Instructions + +## Building and Running + +1. Build the container: +```bash +docker-compose build +``` + +2. Start a shell session: +```bash +docker-compose run --rm repo-to-text +``` + +Once in the shell, you can run repo-to-text: +```bash +# Process current directory +repo-to-text + +# Process specific directory +repo-to-text /home/user/myproject + +# Use with options +repo-to-text --output-dir /home/user/output +``` + +The container mounts your home directory at `/home/user`, allowing access to all your projects. diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c142ab8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM python:3.11-slim + +RUN apt-get update && apt-get install -y \ + tree \ + && rm -rf /var/lib/apt/lists/* + +RUN useradd -m -s /bin/bash user + +WORKDIR /app +COPY . . +RUN pip install -e . && pip install pyperclip + +ENTRYPOINT ["repo-to-text"] diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..75d0efc --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,10 @@ +services: + repo-to-text: + build: . + volumes: + - ${HOME:-/home/user}:/home/user + working_dir: /home/user + environment: + - HOME=/home/user + user: "${UID:-1000}:${GID:-1000}" + entrypoint: ["/bin/bash"]