mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-09-29 08:11:14 +00:00
do something when fastapi start
This commit is contained in:
parent
229d1eed13
commit
473efe528c
|
@ -11,7 +11,7 @@ COPY static ./static
|
|||
COPY requirements.txt main.py database.sqlite ./
|
||||
RUN apt update
|
||||
|
||||
# Install supervisord
|
||||
# Install supervisords
|
||||
RUN apt install -y supervisor
|
||||
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
COPY config/cmd.sh /cmd.sh
|
||||
|
|
|
@ -13,6 +13,10 @@ from fastapi.openapi.docs import (
|
|||
myLogger.info_logger("Start server...")
|
||||
app = FastAPI(docs_url=None, redoc_url=None, openapi_url="/")
|
||||
|
||||
@app.on_event("startup")
|
||||
async def startup_event():
|
||||
print("应用程序已启动!")
|
||||
|
||||
def get_app():
|
||||
origins = [
|
||||
"http://localhost",
|
||||
|
|
Loading…
Reference in a new issue