就是我现在打好了镜像包,可以正常运行了,我现在想用docker-compose来统一管理 的时候遇到问题了,运行了一小会就自动退出了,请问这是什么原因啊,业务代码还是flask api,我们一般用服务器部署的时候(非微服务)都是要求部署FLASK API的服务器内存要尽可能的大
下面是docker-compose的代码:
version: "3"
networks:
basic:
services:
nginx:
image: registry.cn-hangzhou.aliyuncs.com/cow11023/cow11023:nginx
container_name: cow11023-nginx
volumes:
- /System/Volumes/Data/data/interface/certificates/server.crt:/usr/local/nginx/certificates/server.crt
- /System/Volumes/Data/data/interface/certificates/server.key:/usr/local/nginx/certificates/server.key
- /System/Volumes/Data/data/interface/nginx.conf:/usr/local/nginx/conf/nginx.conf
ports:
- “50000:50000”
- "80:80"
command: /usr/local/nginx/sbin/nginx
networks:
- basic
Flask:
image: registry.cn-hangzhou.aliyuncs.com/cow11023/cow11023:interface
container_name: cow11023-interface
mem_limit: 8196m
mem_swappiness: 100
deploy:
resources:
limits:
cpus: '.5’
memory: 4196M
volumes:
- /System/Volumes/Data/data/interface/gun.conf:/home/interface/gun.conf:ro
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
ports:
- "8000:8000"
command: gunicorn -k gevent -c gun.conf app:app --access-logfile - --error-logfile - --log-level debug
networks:
- basic