Fix API
This commit is contained in:
parent
8692a0dbbf
commit
2fbb3adb08
@ -31,6 +31,12 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "2939:8080"
|
- "2939:8080"
|
||||||
|
environment:
|
||||||
|
- "DATABASE_USER=postgres"
|
||||||
|
- "DATABASE_PASS=postgres"
|
||||||
|
- "DATABASE_NAME=postgres"
|
||||||
|
- "DATABASE_HOST=db"
|
||||||
|
- "DATABASE_PORT=5432"
|
||||||
db:
|
db:
|
||||||
image: postgres:alpine
|
image: postgres:alpine
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
@ -115,7 +117,13 @@ app.add_routes([
|
|||||||
|
|
||||||
|
|
||||||
async def run():
|
async def run():
|
||||||
app["pool"] = await db.connect()
|
app["pool"] = await db.connect(
|
||||||
|
os.environ["DATABASE_USER"],
|
||||||
|
os.environ["DATABASE_PASS"],
|
||||||
|
os.environ["DATABASE_NAME"],
|
||||||
|
os.environ["DATABASE_HOST"],
|
||||||
|
int(os.environ["DATABASE_PORT"])
|
||||||
|
)
|
||||||
return app
|
return app
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user