我正在尝试将Flask API应用程序放置到Docker容器中。所有用于构建docker映像以及从docker compose运行的一切工作正常,除非当我执行docker-compose up -d
时,当其下的容器显示为“正在运行”时,它将显示docker compose的状态为“正在停止”
当前Dockerfile
的样子
FROM python:3.7.7-alpine3.11
COPY app /app
WORKDIR /app
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
EXPOSE 5555
ENTRYPOINT ["python3"]
CMD ["app.py"]
和docker-compose.yml
version: '3'
services:
app:
build: .
ports:
- "3000:5555"
volumes:
- ./app:/app
Docker撰写日志:
Attaching to python-api_app_1
app_1 | DEBUG:root:Starting app
app_1 | * Serving Flask app "app" (lazy loading)
app_1 | * Environment: production
app_1 | WARNING: This is a development server. Do not use it in a production deployment.
app_1 | Use a production WSGI server instead.
app_1 | * Debug mode: on
app_1 | INFO:werkzeug: * Running on http://0.0.0.0:5555/ (Press CTRL+C to quit)
app_1 | INFO:werkzeug: * Restarting with stat
app_1 | DEBUG:root:Starting app
app_1 | WARNING:werkzeug: * Debugger is active!
app_1 | INFO:werkzeug: * Debugger PIN: 791-950-860
app_1 | DEBUG:root:Starting app
app_1 | * Serving Flask app "app" (lazy loading)
app_1 | * Environment: production
app_1 | WARNING: This is a development server. Do not use it in a production deployment.
app_1 | Use a production WSGI server instead.
app_1 | * Debug mode: on
app_1 | INFO:werkzeug: * Running on http://0.0.0.0:5555/ (Press CTRL+C to quit)
app_1 | INFO:werkzeug: * Restarting with stat
app_1 | DEBUG:root:Starting app
app_1 | WARNING:werkzeug: * Debugger is active!
app_1 | INFO:werkzeug: * Debugger PIN: 791-950-860
关于这种情况的任何提示为何会以这种方式报告?