https://github.com/Akihi2021/TTTT-Literature-Search
https://hub.docker.com/repository/docker/vinokkk/tttt/
Path: http://localhost:5000/v1/swagger Swagger is autogenerated web-front page with integrated testing.
- All the API's provided are prepended with
v1
- View the expected payload from front-end & Response Model returned by the backend
- Use
try it out
to test the APIs
NOTE: All Response returned by backend abide the rule below
{
"code": 200/500.....
"msg": message as explanation for `data`
"data": {
"success": "val1"
"key1": "val2"
}
When run successfully you should see swagger in the path above
- Install Python Interpreter (v3.8)
- clone codes
git clone https://github.com/Akihi2021/TTTT-Literature-Search
- install requirements
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
- run project
python entrypoint.py
- pull docker image
docker pull vinokkk/tttt:{VERSION_TAG}
- run docker image
docker run -it -p 5000:5000 vinokkk/tttt:{VERSION_TAG}
- For Developer
- Build
- Run
- Push
- For User (Front End Developers)
- Pull
- Run
docker pull vinokkk/tttt:{VERSION_TAG}
NOTE: need to run in the project root path
docker build -t vinokkk/tttt:{VERSION_TAG} .
docker push vinokkk/tttt:{VERSION_TAG}
docker run -it -p 5000:5000 vinokkk/tttt:{VERSION_TAG}
NOTE:
- -p flag binds local port 5000 to the docker container port 5000 which allows us to visit our service with URL localhost:5000
- When run successfully, you should see swagger on localhost:5000/v1/swagger
docker run -it -p 5000:5000 -v {ABSOLUTE_PATH_OF_YOUR_APP}:/app vinokkk/tttt:{VERSION_TAG}
e.g.
docker run -it -p 5000:5000 -v /Users/kim/Intern/momenta/codes/TTTT-Literature-Search:/app vinokkk/tttt:1.0
NOTE:
-
-v flag mount our TTTT project to the /app directory of our container.
-
Since python is a descriptive language, this will allow us to modify our code without having to build docker image each time, simply restart the container will do.