docker - 将 Redash 集成到 Docker 容器中
问题描述
问题:
- 在我的 Docker 中安装 Redash
- 在 Docker 中运行的我的应用程序中提供 Redash 图表
测试容器基本上消除了仅运行 Flask 应用程序进行演示的问题中的任何第 3 方因素。
应用程序.py
from flask import Flask
import os
import socket
app = Flask(__name__)
@app.route("/")
def hello():
html = "<h3>Hello World!</h3>"
return html
if __name__ == "__main__":
app.run(host='0.0.0.0', port=80)
Dockerfile
# Use an official Python runtime as a parent image
FROM python:2.7-slim
# Set the working directory to /app
WORKDIR /app
# Copy the current directory contents into the container at /app
ADD . /app
# Install any needed packages specified in requirements.txt
RUN pip install --trusted-host pypi.python.org -r requirements.txt
# Run app.py when the container launches
CMD ["python", "app.py"]
docker-compose-yaml
version: '3'
services:
redash:
image: redash/redash
ports:
- "5001:5000"
test:
build: .
ports:
- "80:80"
完整的日志:
$ docker-compose up
Starting test1_redash_1 ... done
Recreating test1_test_1 ... done
Attaching to test1_redash_1, test1_test_1
test1_redash_1 exited with code 0
test_1 | * Serving Flask app "app" (lazy loading)
test_1 | * Environment: production
test_1 | WARNING: Do not use the development server in a production environment.
test_1 | Use a production WSGI server instead.
test_1 | * Debug mode: off
test_1 | * Running on http://0.0.0.0:80/ (Press CTRL+C to quit)
test_1 | 192.168.0.1 - - [13/Jul/2018 03:53:08] "GET / HTTP/1.1" 200 -
redash的Dockerhub链接https://hub.docker.com/r/redash/redash/
我究竟做错了什么?
解决方案
推荐阅读
- python - Python 3.6.4 脚本在调试模式下工作,但在终端上运行时返回错误
- linux - select() 是阻塞调用还是非阻塞调用
- r - R:绘制混合效应模型绘制结果
- php - 带有上一期和下一期链接的 WooCommerce 产品类别页面
- python - Python为udp打开多个cmd提示
- sql - 没有重复条件的表并集
- python - 如何使用以下逻辑在python中编写罗马数字到整数转换的代码
- linux - for循环中的slurm作业名称
- c# - 从现有的 Json 流中删除 $ type 和 Id 属性?
- javascript - 使用隐藏和显示自动更新jquery中的多个下拉菜单