加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
docker-compose.yml 1.36 KB
一键复制 编辑 原始数据 按行查看 历史
# https://github.com/Koff/alpine-python3-django-uwsgi-nginx
# Help: https://www.digitalocean.com/community/questions/flask-nginx-uwsgi-ubuntu-tutorial
# more help_ https://www.caktusgroup.com/blog/2017/03/14/production-ready-dockerfile-your-python-django-app/
# more help: https://www.digitalocean.com/community/tutorials/how-to-set-up-uwsgi-and-nginx-to-serve-python-apps-on-ubuntu-14-04
version: '3.3'
services:
python:
build:
context: ./python
ports:
- "5000:5000"
volumes:
- ./logs/app:/usr/src/app/logs
- app_src:/usr/src/app
restart: always
env_file:
- .env
depends_on:
- mongodb
mongodb:
image: mongo:latest
ports:
- "27017:27017"
volumes:
- ./data/db:/data/db
environment:
MONGO_DATA_DIR: /data/db
MONGO_INITDB_ROOT_USERNAME: $MONGO_USERNAME
MONGO_INITDB_ROOT_PASSWORD: $MONGO_PASSWORD
MONGO_INITDB_DATABASE: $MONGO_DBNAME
restart: always
nginx:
build:
context: ./nginx
volumes:
- ./logs/nginx/:/var/log/nginx:cached
- app_src:/usr/src/app
depends_on:
- python
- mongodb
ports:
- 80:80
restart: always
volumes:
app_src:
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化