Refactor Dockerfile and clean up main.py
- Enhanced Dockerfile for platform-specific installations
- Added ARG for TARGETPLATFORM and BUILDPLATFORM
- Improved GPU support conditional on TARGETPLATFORM
- Removed static pages mounting in main.py
- Streamlined code structure to improve maintainability
This commit is contained in:
4
main.py
4
main.py
@@ -340,9 +340,6 @@ app.add_middleware(
|
||||
allow_headers=["*"], # Allows all headers
|
||||
)
|
||||
|
||||
# Mount the pages directory as a static directory
|
||||
app.mount("/pages", StaticFiles(directory=__location__ + "/pages"), name="pages")
|
||||
|
||||
# API token security
|
||||
security = HTTPBearer()
|
||||
CRAWL4AI_API_TOKEN = os.getenv("CRAWL4AI_API_TOKEN") or "test_api_code"
|
||||
@@ -364,7 +361,6 @@ if os.path.exists(__location__ + "/site"):
|
||||
app.mount("/mkdocs", StaticFiles(directory="site", html=True), name="mkdocs")
|
||||
|
||||
site_templates = Jinja2Templates(directory=__location__ + "/site")
|
||||
templates = Jinja2Templates(directory=__location__ + "/pages")
|
||||
|
||||
crawler_service = CrawlerService()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user