mirror of
https://github.com/calibrain/shelfmark.git
synced 2026-09-24 21:20:31 +01:00
Refactor: Improve Docker build, add Tor support, use SeleniumBase
- Overhauled Dockerfile:
- Switched to python:3.10-slim base.
- Implemented multi-stage builds (base, standard, tor).
- Consolidated RUN layers for efficiency.
- Added locale/timezone setup.
- Added Tor setup and iptables configuration in dedicated stage/script.
- Replaced DrissionPage with SeleniumBase for Cloudflare bypassing.
- Added Tor support via `docker-compose.tor.yml` and `tor.sh` script.
- Updated `docker-compose.yml` to build locally and changed default port
to 8083.
- Added `docker-compose.dev.yml` and `docker-compose.tor.dev.yml`.
- Updated `entrypoint.sh` for timezone and sudo usage.
- Added/Updated environment variables (`TZ`, `USING_TOR`, etc.).
- Improved `.dockerignore`.
- Updated `readme.md` to reflect port changes, build process, document
`TZ`, and add details about the new Tor variant.
63 lines
1.6 KiB
JSON
63 lines
1.6 KiB
JSON
{
|
|
"version": "0.2.0",
|
|
"configurations": [
|
|
{
|
|
"name": "Python Debugger: Current File",
|
|
"type": "debugpy",
|
|
"request": "launch",
|
|
"program": "${file}",
|
|
"console": "integratedTerminal",
|
|
"justMyCode": false,
|
|
"env": {
|
|
"INGEST_DIR": "/tmp/cwa-book-downloader",
|
|
"TEMP_DIR": "/tmp/cwa-book-downloader",
|
|
"LOG_LEVEL": "DEBUG",
|
|
"LOG_ROOT": "/tmp/cwa-book-downloader",
|
|
"ENABLE_LOGGING": "true",
|
|
"DOCKERMODE": "false",
|
|
"FLASK_DEBUG": "true"
|
|
},
|
|
},
|
|
{
|
|
"name": "Docker-compose Dev",
|
|
"type": "debugpy", // or "debugpy", Node, etc.
|
|
"request": "launch",
|
|
"program": "${workspaceFolder}/app.py",
|
|
"preLaunchTask": "docker-compose up (dev)", // Spin up dev containers
|
|
"postDebugTask": "docker-compose down (dev)", // Optional: tear them down
|
|
"env": {
|
|
"INGEST_DIR": "/tmp/cwa-book-downloader"
|
|
},
|
|
},
|
|
{
|
|
"name": "Docker-compose Prod",
|
|
"type": "debugpy",
|
|
"request": "launch",
|
|
"program": "${workspaceFolder}/app.py",
|
|
"preLaunchTask": "docker-compose up (prod)",
|
|
"postDebugTask": "docker-compose down (prod)",
|
|
"env": {
|
|
"INGEST_DIR": "/tmp/cwa-book-downloader"
|
|
},
|
|
},
|
|
{
|
|
"type": "chrome",
|
|
"request": "launch",
|
|
"name": "Launch Browser",
|
|
"url": "http://localhost:8000",
|
|
"webRoot": "${workspaceFolder}",
|
|
"presentation": {
|
|
"hidden": true
|
|
}
|
|
}
|
|
],
|
|
"compounds": [
|
|
{
|
|
"name": "Launch CWA-BD",
|
|
"configurations": [
|
|
"Launch cwa-bd app.py",
|
|
"Launch Browser"
|
|
]
|
|
}
|
|
]
|
|
} |