I temporally use python 3.10. But we will discuss python version in this project in #11.
Add docker-compose.yaml for build (sorry this should be done in #4 but I implemented backend part).
Install backend dependencies
fastapi
uvicorn
gunicorn
pydantic
Add a make command to run backend.
How to test
Run backend application
% cd environments/cpu
% sudo docker compose up -d
% sudo docker compose exec backend bash
# enter the backend container
$ poetry install
$ make run-backend
poetry run gunicorn 'src.app:main' -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8000 -t 60 --log-level info
[2023-04-26 16:06:13 +0000] [114] [INFO] Starting gunicorn 20.1.0
[2023-04-26 16:06:13 +0000] [114] [INFO] Listening at: http://0.0.0.0:8000 (114)
[2023-04-26 16:06:13 +0000] [114] [INFO] Using worker: uvicorn.workers.UvicornWorker
[2023-04-26 16:06:13 +0000] [117] [INFO] Booting worker with pid: 117
[2023-04-26 16:06:14 +0000] [117] [WARNING] ASGI app factory detected. Using it, but please consider setting the --factory flag explicitly.
[2023-04-26 16:06:14 +0000] [117] [INFO] Started server process [117]
[2023-04-26 16:06:14 +0000] [117] [INFO] Waiting for application startup.
[2023-04-26 16:06:14 +0000] [117] [INFO] Application startup complete.
Visit http://localhost:8000/docs. You will see the page like following.
You can also try health endpoint by pushing "Try it out" button and "Execute" button.
After test please don't forget to stop or down containers.
Issue URL
6
Change overview
docker-compose.yaml
for build (sorry this should be done in #4 but I implemented backend part).How to test
Visit
http://localhost:8000/docs
. You will see the page like following. You can also tryhealth
endpoint by pushing "Try it out" button and "Execute" button.After test please don't forget to stop or down containers.
Note for reviewers
NA