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 启动了,另外一个一直在重启的状态,求解