Fixed assets mounting in app and container
This commit is contained in:
parent
0df1d50612
commit
543b7b0c46
@ -29,4 +29,7 @@ dist-ssr
|
||||
uploads/
|
||||
.env
|
||||
|
||||
poems.txt
|
||||
poem_pic/
|
||||
|
||||
__pycache__
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -29,4 +29,6 @@ dist-ssr
|
||||
uploads/
|
||||
.env
|
||||
|
||||
poem_pic/
|
||||
|
||||
__pycache__
|
@ -35,5 +35,5 @@ Only docker/podman are required
|
||||
```sh
|
||||
docker build . -t porridger:build
|
||||
|
||||
docker run --name porridger -p 8000:8000 -v ./sql_app.db:/srv/sql_app.db -v uploads:/srv/uploads -v poem_pic:/srv/poem_pic porridger:build
|
||||
docker run --name porridger -p 8000:8000 -v ./sql_app.db:/srv/sql_app.db -v ./poems.txt:/srv/poems.txt -v ./poem_pic:/srv/poem_pic -v uploads:/srv/uploads porridger:build
|
||||
```
|
||||
|
@ -10,7 +10,7 @@ import datetime
|
||||
|
||||
# Загружаем стихи
|
||||
async def add_poems_to_db(async_db: AsyncSession):
|
||||
f1 = open('text121.txt', encoding='utf-8', mode='r')#открыть фаил для чтения на русском
|
||||
f1 = open('poems.txt', encoding='utf-8', mode='r')#открыть фаил для чтения на русском
|
||||
for a in range(1, 110):
|
||||
f1.seek(0)#перейти к началу
|
||||
i=0
|
||||
|
@ -46,7 +46,7 @@ app.mount("/uploads", StaticFiles(directory = "./uploads"))
|
||||
# эндпоинт для возвращения согласия в pdf
|
||||
@app.get("/privacy_policy.pdf")
|
||||
async def privacy_policy():
|
||||
return FileResponse("privacy_policy.pdf")
|
||||
return FileResponse("./privacy_policy.pdf")
|
||||
|
||||
# получение списка объявлений
|
||||
@app.get("/api/announcements", response_model=List[pydantic_schemas.Announcement])#адрес объявлений
|
||||
|
BIN
privacy_policy.pdf
Normal file
BIN
privacy_policy.pdf
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user