A mongodb api service using fastapi, deployed using docker-compose
git clone https://github.com/Char1esOrz/mongodb-fastapi-docker-composecd mongodb-fastapi-docker-composecp .env.example .envNow you can modify the .env file to set the parameters of mongodb and fastapi
vim .env如果你在国内,请修改Dockerfile 增加 -i https://pypi.tuna.tsinghua.edu.cn/simple
vim .env
#修改
RUN pip install --no-cache-dir -r requirements.txt
# 为
RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
Run
docker compose upOpen the server by clicking on the following link: http://localhost:8000/docs