assemble docker image with frontend and api
All checks were successful
Build Container / Build Container (push) Successful in 1m30s
All checks were successful
Build Container / Build Container (push) Successful in 1m30s
This commit is contained in:
parent
196e759487
commit
cb570a7663
2 changed files with 17 additions and 13 deletions
|
|
@ -40,12 +40,22 @@ def main():
|
|||
default=os.environ.get("DOORIS_BASE_URL", None),
|
||||
help="The Base-URL that this application is reachable under",
|
||||
)
|
||||
argp.add_argument(
|
||||
"--serve-static",
|
||||
required=False,
|
||||
default=os.environ.get("DOORIS_SERVE_STATIC", None),
|
||||
help="In addition to the API functionality, serve static files from this path",
|
||||
)
|
||||
args = argp.parse_args()
|
||||
|
||||
app_config.set(args)
|
||||
import uvicorn
|
||||
from dooris_api.app import app
|
||||
|
||||
if args.serve_static:
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
app.mount("/", StaticFiles(directory=args.serve_static, html=True), name="static")
|
||||
|
||||
config = uvicorn.Config(app, port=8000, log_level="debug")
|
||||
server = uvicorn.Server(config)
|
||||
server.run()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue