Skip to content

Commit

Permalink
Merge pull request #7 from leftmove/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
leftmove authored May 2, 2024
2 parents 985e870 + ab871fe commit a760766
Show file tree
Hide file tree
Showing 13 changed files with 482 additions and 263 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.gitignore
.venv
__pycache__/*
2 changes: 1 addition & 1 deletion database/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mongo:4.4.6
FROM mongo:7.0

WORKDIR /data

Expand Down
11 changes: 5 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,19 @@
HOST = os.environ.get("HOST", "0.0.0.0")
EXPOSE_PORT = int(os.environ.get("EXPOSE_PORT", 8000))
FORWARDED_ALLOW_IPS = os.environ.get("FORWARDED_ALLOW_IPS", "*")
WORKERS = int(os.environ.get("WORKERS", ((multiprocessing.cpu_count() * 2) + 1)))
WORKERS = int(os.environ.get("WORKERS", (multiprocessing.cpu_count() + 1)))
production_environment = True if ENVIRONMENT == "production" else False

middleware = [
Middleware(
CORSMiddleware, allow_origins=["*"], allow_methods=["*"], allow_headers=["*"]
),
]
l = logging.getLogger("uvicorn.access")
log = logging.getLogger("uvicorn.access")
log_config = uvicorn.config.LOGGING_CONFIG
log_config["formatters"]["access"][
"fmt"
] = "%(asctime)s %(levelname)s [%(name)s] [%(filename)s:%(lineno)d] - %(message)s"

log_config["formatters"]["access"]["fmt"] = (
"%(asctime)s %(levelname)s [%(name)s] [%(filename)s:%(lineno)d] - %(message)s"
)

app = FastAPI(middleware=middleware)
app.include_router(general.router)
Expand Down
286 changes: 285 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ tqdm = "^4.66.2"
typing-extensions = "^4.10.0"
urllib3 = "^2.2.1"
uvicorn = "^0.28.0"
celery = {extras = ["redis"], version = "^5.4.0"}
sentry-sdk = {extras = ["celery"], version = "^2.0.1"}

[tool.poetry.scripts]
dev = "main"
Expand Down
Loading

0 comments on commit a760766

Please sign in to comment.