3

Problem:

  1. Install Redash in my Docker
  2. Make Redash charts available inside my App that is running in Docker

Test container that is basically removing any 3rd party factor in the issue that just runs a Flask app for demo.

app.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"

Complete log:

$ 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 -

Dockerhub link for redash https://hub.docker.com/r/redash/redash/


What am I doing wrong?

Srinath Ganesh
  • 2,101
  • 2
  • 22
  • 44

0 Answers0