poetry-rty
This commit is contained in:
parent
12416c1b83
commit
b64d9d5014
13
Dockerfile
13
Dockerfile
|
@ -1,10 +1,9 @@
|
|||
FROM python:slim
|
||||
WORKDIR /app
|
||||
|
||||
EXPOSE 8080
|
||||
# ADD nginx.conf.sigil ./
|
||||
COPY requirements.txt .
|
||||
RUN apt update && apt install -y build-essential git
|
||||
ENV GIT_SSH_COMMAND="ssh -v"
|
||||
RUN pip install -r requirements.txt
|
||||
ENV PYTHONDONTWRITEBYTECODE 1
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
ENV GIT_SSH_COMMAND "ssh -v"
|
||||
WORKDIR /app
|
||||
RUN pip install poetry
|
||||
COPY . .
|
||||
RUN poetry install
|
||||
|
|
12
main.py
12
main.py
|
@ -17,13 +17,13 @@ from services.redis import redis
|
|||
from services.schema import resolvers
|
||||
from resolvers.auth import confirm_email_handler
|
||||
from resolvers.upload import upload_handler
|
||||
from services.main import storages_init
|
||||
from services.viewed import ViewedStorage
|
||||
from settings import DEV_SERVER_PID_FILE_NAME, SENTRY_DSN
|
||||
from services.search import SearchService
|
||||
from services.viewed import ViewedStorage
|
||||
from services.db import local_session
|
||||
|
||||
import_module("resolvers")
|
||||
schema = make_executable_schema(load_schema_from_path("schemas/core.graphql"), resolvers) # type: ignore
|
||||
|
||||
middleware = [
|
||||
Middleware(AuthenticationMiddleware, backend=JWTAuthenticate()),
|
||||
Middleware(SessionMiddleware, secret_key="!secret"),
|
||||
|
@ -33,8 +33,10 @@ middleware = [
|
|||
async def start_up():
|
||||
init_tables()
|
||||
await redis.connect()
|
||||
await storages_init()
|
||||
views_stat_task = asyncio.create_task(ViewedStorage().worker())
|
||||
with local_session() as session:
|
||||
await SearchService.init(session)
|
||||
await ViewedStorage.init()
|
||||
_views_stat_task = asyncio.create_task(ViewedStorage().worker())
|
||||
try:
|
||||
import sentry_sdk
|
||||
|
||||
|
|
1340
poetry.lock
generated
Normal file
1340
poetry.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
37
pyproject.toml
Normal file
37
pyproject.toml
Normal file
|
@ -0,0 +1,37 @@
|
|||
[tool.poetry]
|
||||
name = "discoursio-core"
|
||||
version = "0.2.5"
|
||||
description = ""
|
||||
authors = ["Tony Rewin <anton.rewin@gmail.com>"]
|
||||
readme = "README.md"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.11"
|
||||
gql = {extras = ["httpx"], version = "^3.4.1"}
|
||||
ariadne = "^0.20.1"
|
||||
SQLAlchemy = "^2.0.21"
|
||||
uvicorn = "^0.23.2"
|
||||
aredis = "^1.1.8"
|
||||
starlette = "^0.31.1"
|
||||
itsdangerous = "^2.1.2"
|
||||
Authlib = "^1.2.1"
|
||||
PyJWT = "^2.8.0"
|
||||
PyYAML = "^6.0.1"
|
||||
httpx = "^0.25.0"
|
||||
psycopg2-binary = "^2.9.9"
|
||||
bcrypt = "^4.0.1"
|
||||
sentry-sdk = "^1.31.0"
|
||||
boto3 = "^1.28.61"
|
||||
botocore = "^1.31.61"
|
||||
transliterate = "^1.10.2"
|
||||
passlib = "^1.7.4"
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
flake8 = "^6.1.0"
|
||||
isort = "^5.12.0"
|
||||
brunette = "^0.2.8"
|
||||
mypy = "^1.5.1"
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core"]
|
||||
build-backend = "poetry.core.masonry.api"
|
|
@ -1,4 +0,0 @@
|
|||
isort
|
||||
brunette
|
||||
flake8
|
||||
mypy
|
|
@ -1,28 +0,0 @@
|
|||
aredis>=1.1.8
|
||||
httpx>=0.23.0
|
||||
git+https://github.com/graphql-python/gql.git#master
|
||||
git+https://github.com/encode/starlette.git#main
|
||||
sqlalchemy>=1.4.41
|
||||
git+https://github.com/tonyrewin/ariadne.git#master
|
||||
uvicorn>=0.18.3
|
||||
python-frontmatter~=1.0.0
|
||||
PyYAML>=5.4
|
||||
pyjwt>=2.6.0
|
||||
pydantic>=1.10.2
|
||||
passlib~=1.7.4
|
||||
itsdangerous
|
||||
authlib>=1.1.0
|
||||
psycopg2-binary
|
||||
bcrypt>=4.0.0
|
||||
websockets
|
||||
flake8
|
||||
python-dateutil~=2.8.2
|
||||
lxml
|
||||
sentry-sdk>=1.14.0
|
||||
boto3~=1.28.2
|
||||
botocore~=1.31.2
|
||||
python-multipart~=0.0.6
|
||||
alembic==1.11.3
|
||||
Mako==1.2.4
|
||||
MarkupSafe==2.1.3
|
||||
transliterate
|
|
@ -1,9 +0,0 @@
|
|||
from services.search import SearchService
|
||||
from services.viewed import ViewedStorage
|
||||
from services.db import local_session
|
||||
|
||||
|
||||
async def storages_init():
|
||||
with local_session() as session:
|
||||
await SearchService.init(session)
|
||||
await ViewedStorage.init()
|
Loading…
Reference in New Issue
Block a user