Skip to content

Commit

Permalink
superset fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Mancevice committed Nov 11, 2016
1 parent 2c16e7a commit 566afee
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 8 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ RUN apk add --no-cache \
ENV LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
PATH=$PATH:/home/superset/.bin \
PYTHONPATH=/home/superset/superset_config.py:$PYTHONPATH
PYTHONPATH=/home/superset/superset_config.py:$PYTHONPATH \
SQLALCHEMY_DATABASE_URI=sqlite:////home/superset/.superset/superset.db

# Run as superset user
WORKDIR /home/superset
COPY superset .
RUN addgroup superset && \
adduser -h /home/superset -G superset -D superset && \
mkdir /home/superset/db && \
mkdir /home/superset/.superset && \
touch /home/superset/.superset/superset.db && \
chown -R superset:superset /home/superset
USER superset

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Docker image for [AirBnB's Superset](https://github.com/airbnb/superset).
Run the superset demo by entering this command into your console:

```bash
docker run --name superset -d -p 8088:8088 amancevice/superset
docker exec -it superset demo
docker-compose up -d
docker-compose exec superset demo
```

You will be prompted to set up an admin user.
Expand Down
35 changes: 35 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: '2'
services:
redis:
image: redis:alpine
restart: always
volumes:
- redis:/data
mysql:
image: mysql:5.7
restart: always
environment:
MYSQL_ROOT_PASSWORD: superset
MYSQL_DATABASE: superset
MYSQL_USER: superset
MYSQL_PASSWORD: superset
volumes:
- mysql:/var/lib/mysql
superset:
build: .
image: amancevice/superset
restart: always
depends_on:
- mysql
- redis
environment:
SECRET_KEY: thisISaSECRET_1234
SQLALCHEMY_DATABASE_URI: mysql://superset:superset@mysql:3306/superset
CACHE_CONFIG: "{\"CACHE_TYPE\": \"redis\", \"CACHE_DEFAULT_TIMEOUT\": 300, \"CACHE_KEY_PREFIX\": \"caravel_\", \"CACHE_REDIS_HOST\": \"redis\", \"CACHE_REDIS_PORT\": 6379, \"CACHE_REDIS_DB\": 1, \"CACHE_REDIS_URL\": \"redis://redis:6379/1\"}"
ports:
- "8888:8088"
volumes:
mysql:
external: false
redis:
external: false
9 changes: 5 additions & 4 deletions superset/superset_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
ROW_LIMIT = int(os.getenv("ROW_LIMIT", 5000))
WEBSERVER_THREADS = int(os.getenv("WEBSERVER_THREADS", 8))

CARAVEL_WEBSERVER_PORT = int(os.getenv("CARAVEL_WEBSERVER_PORT", 8088))
SUPERSET_WEBSERVER_PORT = int(os.getenv("SUPERSET_WEBSERVER_PORT", 8088))
# ---------------------------------------------------------

# ---------------------------------------------------------
Expand All @@ -18,7 +18,8 @@

# The SQLAlchemy connection string.
SQLALCHEMY_DATABASE_URI = os.getenv(
"SQLALCHEMY_DATABASE_URI", "sqlite:////home/caravel/.caravel/caravel.db")
"SQLALCHEMY_DATABASE_URI",
"sqlite:////home/superset/.superset/superset.db")

# Flask-WTF flag for CSRF
CSRF_ENABLED = os.getenv("CSRF_ENABLED", "1") in ("True", "true", "1")
Expand All @@ -34,8 +35,8 @@
except ValueError:
CACHE_CONFIG = {}

# Import all the env variables prefixed with "CARAVEL_"
config_keys = [c for c in os.environ if c.startswith("CARAVEL_")]
# Import all the env variables prefixed with "SUPERSET_"
config_keys = [c for c in os.environ if c.startswith("SUPERSET_")]
for key in config_keys:
globals()[key[8:]] = os.environ[key]

Expand Down

0 comments on commit 566afee

Please sign in to comment.