Skip to content

Commit b948dba

Browse files
committed
build with Dockerfile
1 parent d50a677 commit b948dba

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

Dockerfile

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Use Python 3.8 as base - this version has good compatibility with older packages
2+
FROM python:3.8-slim
3+
4+
# Set working directory
5+
WORKDIR /app
6+
7+
# Install git (needed for pip install from git repos)
8+
RUN apt-get update && \
9+
apt-get install -y git && \
10+
apt-get clean && \
11+
rm -rf /var/lib/apt/lists/*
12+
13+
# Copy only the necessary files
14+
COPY github-dork.py /app/
15+
COPY github-dorks.txt /app/
16+
COPY setup.py /app/
17+
COPY README.md /app/
18+
COPY requirements.txt /app/
19+
20+
# Install dependencies
21+
# Using the specific version of github3.py that's known to work
22+
RUN pip install --no-cache-dir github3.py==1.0.0a2 feedparser==6.0.2
23+
24+
# Set environment variables
25+
ENV PYTHONUNBUFFERED=1
26+
ENV PYTHONIOENCODING=UTF-8
27+
28+
# Create volume for potential output files
29+
VOLUME ["/app/output"]
30+
31+
ENTRYPOINT ["python", "github-dork.py"]

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,24 @@ Clone this repository and run:
1616
pip install .
1717
```
1818

19+
### Docker Installation
20+
21+
You can also run github-dorks using Docker for a consistent environment:
22+
23+
```shell
24+
# Build the Docker image
25+
docker build -t github-dorks .
26+
27+
# Run with a GitHub token (recommended)
28+
docker run -e GH_TOKEN=your_github_token github-dorks -u someuser
29+
30+
# Run with username/password
31+
docker run -e GH_USER=your_username -e GH_PWD=your_password github-dorks -u someuser
32+
33+
# Save results to a CSV file
34+
docker run -v $(pwd)/output:/app/output -e GH_TOKEN=your_github_token github-dorks -u someuser -o /app/output/results.csv
35+
```
36+
1937
### Usage
2038

2139
```

0 commit comments

Comments
 (0)