fix env file usage
This commit is contained in:
@@ -3,3 +3,4 @@
|
||||
/files
|
||||
/subdomain_files
|
||||
/logs
|
||||
/.env
|
||||
|
||||
@@ -7,7 +7,7 @@ from sanic.exceptions import NotFound, MethodNotAllowed
|
||||
from sanic_cors import CORS
|
||||
from sanic_ext import Extend
|
||||
|
||||
from conf import STATIC_DIR
|
||||
from conf import STATIC_DIR, BASE_HOSTS
|
||||
from utils import get_j2env, get_sort_icon, get_sort_link, resolve_path, list_dir
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ app = Sanic('autoindex', strict_slashes=True)
|
||||
Extend(app)
|
||||
cors = CORS(app)
|
||||
app.static('/~static/', STATIC_DIR, use_content_range=True, stream_large_files=True)
|
||||
print(STATIC_DIR)
|
||||
j2env = get_j2env(DEBUG)
|
||||
|
||||
|
||||
@@ -63,6 +62,7 @@ async def index(request: Request, path=''):
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(f'{BASE_HOSTS=}')
|
||||
if DEBUG:
|
||||
app.run(host='0.0.0.0', port=8000, debug=True, auto_reload=True)
|
||||
else:
|
||||
|
||||
@@ -6,6 +6,8 @@ services:
|
||||
- "./subdomain_files:/src/subdomain_files"
|
||||
ports:
|
||||
- "8000:8000"
|
||||
env_file:
|
||||
- .env
|
||||
develop:
|
||||
watch:
|
||||
- action: sync+restart
|
||||
|
||||
Reference in New Issue
Block a user