docker-compose.yml:
version: "3.3"
services:
flask_app:
build: ./flask_app
container_name: flask_app
restart: always
environment:
- APP_NAME=MyFlaskApp
expose:
- 8080
nginx:
build: ./nginx
container_name: nginx
restart: always
ports:
- "80:80"
nginx.conf
server {
listen 80;
charset UTF-8;
client_max_body_size 30M;
location / {
include uwsgi_params;
uwsgi_pass flask:8080;
}
}
uwsgi.ini
[uwsgi]
wsgi-file = app.py
callable = app
socket = :8080
processes = 4
threads = 2
master = true
chmod-socket = 660
vacuum = true
die-on-term = true
buffer-size = 65535
limit-post = 104857600
logto = /flask_app/app.log
Dockerfile
FROM python:3.6
WORKDIR /app
ADD . /app
RUN pip install -r requirements.txt
CMD ["uwsgi", "uwsgi.ini"]
以上分别是我 docker-compose, nginx, uwsgi 以及 dockerfile 的配置,但是启动话只有 nginx 启动了,另外一个一直在重启的状态,求解
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.