Skip to content

Commit c662485

Browse files
authored
Fix Docker environment configuration (#5)
* Setup explicit `host` binding The process needs to bind to `0.0.0.0` when run inside Docker. Otherwise, port forwarding won't work. * Fix credentials path The argument should take credentials location as an absolute path inside Docker, as the CWD is set to /data.
1 parent 24351b7 commit c662485

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ docker run --rm -it \
2828
-p 3000:3000 \
2929
-v "$(pwd)/creds:/creds" \
3030
ghcr.io/schlomo/github-backup-app:latest \
31+
--host 0.0.0.0 \
3132
/creds
3233
```
3334
This will:
@@ -45,7 +46,7 @@ docker run --rm -it \
4546
-v "$(pwd)/creds:/creds:ro" \
4647
ghcr.io/schlomo/github-backup-app:latest \
4748
--app-id $(cat ./creds/*-app-id.txt) \
48-
--private-key ./creds/$(ls ./creds/*-private-key.pem | head -1 | xargs basename) \
49+
--private-key /creds/$(ls ./creds/*-private-key.pem | head -1 | xargs basename) \
4950
--all \
5051
--output-directory /data
5152
```

github_backup/create_github_app.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,9 @@ def main():
755755
"output_dir",
756756
help="Directory to save the app credentials (App ID, private key, client secret)",
757757
)
758+
parser.add_argument(
759+
"--host", default="127.0.0.1", help="Host to bind to (default: localhost)"
760+
)
758761
parser.add_argument(
759762
"--port", type=int, default=3000, help="Port for the web server (default: 3000)"
760763
)
@@ -800,7 +803,7 @@ def main():
800803
# Use Werkzeug directly to avoid Flask startup messages
801804
from werkzeug.serving import make_server
802805

803-
server = make_server("localhost", args.port, app, threaded=True)
806+
server = make_server(args.host, args.port, app, threaded=True)
804807
server.serve_forever()
805808

806809
except KeyboardInterrupt:

0 commit comments

Comments
 (0)