mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Dockerfile + set up mangum
This commit is contained in:
parent
33b681bace
commit
6193948b2f
3 changed files with 27 additions and 0 deletions
|
|
@ -1,4 +1,5 @@
|
|||
from fastapi import FastAPI, Depends
|
||||
from mangum import Mangum
|
||||
from app.portfolio import router as portfolio_router
|
||||
from app.dependencies import validate_api_key, validate_token
|
||||
from app.config import get_settings
|
||||
|
|
@ -12,3 +13,5 @@ app.include_router(portfolio_router.router)
|
|||
if get_settings().ENVIRONMENT == "local":
|
||||
from app.local import router as local_router
|
||||
app.include_router(local_router.router)
|
||||
|
||||
handler = Mangum(app)
|
||||
|
|
|
|||
23
backend/docker/Dockerfile
Normal file
23
backend/docker/Dockerfile
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
# Pull base image
|
||||
FROM python:3.10.12-slim-buster
|
||||
|
||||
# Set environment variables
|
||||
ENV PYTHONDONTWRITEBYTECODE 1
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
|
||||
# Set work directory
|
||||
WORKDIR /app
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y netcat-openbsd
|
||||
|
||||
# Install python dependencies
|
||||
COPY ./requirements/base.txt ./requirements/base.txt
|
||||
RUN pip install --upgrade pip
|
||||
RUN pip install -r requirements/base.txt
|
||||
|
||||
# Copy project
|
||||
COPY . .
|
||||
|
||||
# command to run on container start
|
||||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
|
|
@ -8,6 +8,7 @@ fastapi==0.99.1
|
|||
h11==0.14.0
|
||||
httptools==0.5.0
|
||||
idna==3.4
|
||||
mangum==0.17.0
|
||||
pyasn1==0.5.0
|
||||
pycparser==2.21
|
||||
pydantic==1.10.11
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue