File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ __pycache__/
2020* $py.class
2121* .so
2222.Python
23+ .venv
2324
2425# IDE
2526.vscode /
Original file line number Diff line number Diff line change @@ -3,8 +3,11 @@ FROM python:3.9-slim
33# Set working directory
44WORKDIR /app
55
6+ # Copy requirements first for better caching
7+ COPY requirements.txt .
8+
69# Install Python dependencies
7- RUN pip install --no-cache-dir flask requests urllib3
10+ RUN pip install --no-cache-dir -r requirements.txt
811
912# Copy application files
1013COPY index.html .
Original file line number Diff line number Diff line change @@ -50,15 +50,7 @@ def load_config():
5050def index ():
5151 return send_from_directory ('.' , 'index.html' )
5252
53- # Serve static files
54- @app .route ('/<path:path>' )
55- def serve_static (path ):
56- # Special handling for config.json
57- if path == 'config.json' :
58- return send_from_directory ('config' , 'config.json' )
59- return send_from_directory ('.' , path )
60-
61- # Proxy API requests to KaraKeep
53+ # Proxy API requests to KaraKeep - MUST come before catch-all route
6254@app .route ('/api/karakeep/<path:path>' )
6355def proxy_karakeep (path ):
6456 config = load_config ()
@@ -121,6 +113,14 @@ def save_preferences():
121113def handle_options (path ):
122114 return '' , 200
123115
116+ # Serve static files - MUST come last as it's a catch-all
117+ @app .route ('/<path:path>' )
118+ def serve_static (path ):
119+ # Special handling for config.json
120+ if path == 'config.json' :
121+ return send_from_directory ('config' , 'config.json' )
122+ return send_from_directory ('.' , path )
123+
124124if __name__ == '__main__' :
125125 ensure_config_exists ()
126126 print ("KaraKeep HomeDash Server (Flask) starting..." )
You can’t perform that action at this time.
0 commit comments