From f345ed6587d76f1523bbc5f0c47eb423e69eb7e8 Mon Sep 17 00:00:00 2001 From: dm1sh Date: Wed, 16 Aug 2023 09:35:22 +0300 Subject: [PATCH] Updated deployment instructions and container --- Dockerfile | 2 +- README.md | 10 +++++----- back/main.py | 2 +- requirements.txt | 37 ++++++++++++++++++------------------- 4 files changed, 25 insertions(+), 26 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7cbd86e..e8cacab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,4 +11,4 @@ COPY requirements.txt . RUN pip install --no-cache-dir --upgrade -r requirements.txt COPY ./back ./back COPY --from=builder /src/dist ./front/dist -CMD uvicorn back.main:app --host 0.0.0.0 --port 80 +CMD python -m back.main diff --git a/README.md b/README.md index 102c933..b546806 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ Food and other stuff sharing platform. The service was developed during Digital Members: -* Dmitry Gantimurov - Backend -* Dmitriy Shishkov - Frontend -* Vladimir Yakovlev - Backend & Design +* Dmitry Gantimurov - Chief Backend +* Dmitriy Shishkov - Frontend & Interface Design +* Vladimir Yakovlev - Backend & Graphical Design ## Dev build instructions @@ -25,7 +25,7 @@ Backend: ```sh pip install -r requirements.txt -uvicorn back.main:app --reload +python -m back.main ``` ## Deploy instructions @@ -35,5 +35,5 @@ Only docker/podman are required ```sh docker build . -t porridger:build -docker run --name porridger -p 8080:80 -v ./sql_app.db:/srv/sql_app.db -v uploads:/srv/uploads 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 ``` diff --git a/back/main.py b/back/main.py index 9677a1a..564539b 100644 --- a/back/main.py +++ b/back/main.py @@ -16,7 +16,7 @@ class Server(uvicorn.Server): async def main(): "Run scheduler and the API" - server = Server(config=uvicorn.Config(app_fastapi, workers=1, loop="asyncio")) + server = Server(config=uvicorn.Config(app_fastapi, workers=1, loop="asyncio", host="0.0.0.0")) api = asyncio.create_task(server.serve()) sched = asyncio.create_task(app_rocketry.serve()) diff --git a/requirements.txt b/requirements.txt index 74aab9b..2a1c749 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,31 +1,30 @@ -anyio==3.6.2 -certifi==2023.5.7 -charset-normalizer==3.1.0 -click==8.1.3 +annotated-types==0.5.0 +anyio==3.7.1 +certifi==2023.7.22 +charset-normalizer==3.2.0 +click==8.1.6 ecdsa==0.18.0 -fastapi==0.95.1 +fastapi==0.101.1 greenlet==2.0.2 h11==0.14.0 -httptools==0.5.0 idna==3.4 Jinja2==3.1.2 -MarkupSafe==2.1.2 +MarkupSafe==2.1.3 passlib==1.7.4 pyasn1==0.5.0 -pydantic==1.10.7 -python-dotenv==1.0.0 +pydantic==1.10.10 +pydantic_core==2.4.0 +python-dateutil==2.8.2 python-jose==3.3.0 python-multipart==0.0.6 -PyYAML==6.0 -requests==2.30.0 +redbird==0.7.1 +requests==2.31.0 +rocketry==2.5.1 rsa==4.9 six==1.16.0 sniffio==1.3.0 -SQLAlchemy==2.0.13 -starlette==0.26.1 -typing_extensions==4.5.0 -urllib3==2.0.2 -uvicorn==0.22.0 -uvloop==0.17.0 -watchfiles==0.19.0 -websockets==11.0.3 +SQLAlchemy==2.0.20 +starlette==0.27.0 +typing_extensions==4.7.1 +urllib3==2.0.4 +uvicorn==0.23.2