mirror of
https://github.com/vimagick/dockerfiles.git
synced 2025-01-12 04:23:04 +02:00
update superset
This commit is contained in:
parent
2087357ce1
commit
910037364e
@ -4,13 +4,21 @@ superset
|
||||
## Up and Running
|
||||
|
||||
```bash
|
||||
$ mkdir -m 777 data
|
||||
$ mkdir -p -m 777 data/superset
|
||||
$ wget -P data/superset https://github.com/amancevice/superset/raw/master/examples/celery/superset/superset_config.py
|
||||
|
||||
$ echo 'ENABLE_PROXY_FIX = True' >> data/superset/superset_config.py
|
||||
$ echo 'MAPBOX_API_KEY=pk.xxxxxx.xxxxxx' > .env
|
||||
|
||||
$ docker-compose up -d
|
||||
$ docker-compose exec superset superset-init
|
||||
|
||||
Username [admin]: admin
|
||||
User first name [admin]:
|
||||
User last name [user]:
|
||||
Email [admin@fab.org]:
|
||||
Password: ******
|
||||
Repeat for confirmation: ******
|
||||
|
||||
$ curl http://localhost:8088
|
||||
```
|
||||
|
34
superset/data/superset/superset_config.py
Normal file
34
superset/data/superset/superset_config.py
Normal file
@ -0,0 +1,34 @@
|
||||
import os
|
||||
|
||||
from werkzeug.contrib.cache import RedisCache
|
||||
|
||||
|
||||
MAPBOX_API_KEY = os.getenv('MAPBOX_API_KEY', '')
|
||||
CACHE_CONFIG = {
|
||||
'CACHE_TYPE': 'redis',
|
||||
'CACHE_DEFAULT_TIMEOUT': 300,
|
||||
'CACHE_KEY_PREFIX': 'superset_',
|
||||
'CACHE_REDIS_HOST': 'redis',
|
||||
'CACHE_REDIS_PORT': 6379,
|
||||
'CACHE_REDIS_DB': 1,
|
||||
'CACHE_REDIS_URL': 'redis://redis:6379/1'}
|
||||
SQLALCHEMY_DATABASE_URI = \
|
||||
'postgresql+psycopg2://superset:superset@postgres:5432/superset'
|
||||
SQLALCHEMY_TRACK_MODIFICATIONS = True
|
||||
SECRET_KEY = 'thisISaSECRET_1234'
|
||||
|
||||
|
||||
class CeleryConfig(object):
|
||||
BROKER_URL = 'redis://redis:6379/0'
|
||||
CELERY_IMPORTS = ('superset.sql_lab', )
|
||||
CELERY_RESULT_BACKEND = 'redis://redis:6379/0'
|
||||
CELERY_ANNOTATIONS = {'tasks.add': {'rate_limit': '10/s'}}
|
||||
|
||||
|
||||
CELERY_CONFIG = CeleryConfig
|
||||
RESULTS_BACKEND = RedisCache(
|
||||
host='redis',
|
||||
port=6379,
|
||||
key_prefix='superset_results'
|
||||
)
|
||||
ENABLE_PROXY_FIX = True
|
@ -1,7 +1,44 @@
|
||||
superset:
|
||||
image: amancevice/superset
|
||||
ports:
|
||||
- "8088:8088"
|
||||
volumes:
|
||||
- ./data:/var/lib/superset
|
||||
restart: always
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
|
||||
redis:
|
||||
image: redis
|
||||
volumes:
|
||||
- ./data/redis:/data
|
||||
restart: always
|
||||
|
||||
postgres:
|
||||
image: postgres
|
||||
volumes:
|
||||
- ./data/postgres:/var/lib/postgresql/data
|
||||
environment:
|
||||
POSTGRES_DB: superset
|
||||
POSTGRES_PASSWORD: superset
|
||||
POSTGRES_USER: superset
|
||||
restart: always
|
||||
|
||||
superset:
|
||||
image: amancevice/superset
|
||||
ports:
|
||||
- "8088:8088"
|
||||
volumes:
|
||||
- ./data/superset:/etc/superset
|
||||
environment:
|
||||
MAPBOX_API_KEY: ${MAPBOX_API_KEY}
|
||||
depends_on:
|
||||
- postgres
|
||||
- redis
|
||||
restart: always
|
||||
|
||||
worker:
|
||||
image: amancevice/superset
|
||||
command: celery worker
|
||||
volumes:
|
||||
- ./data/superset:/etc/superset
|
||||
environment:
|
||||
MAPBOX_API_KEY: ${MAPBOX_API_KEY}
|
||||
depends_on:
|
||||
- postgres
|
||||
- redis
|
||||
restart: always
|
||||
|
Loading…
Reference in New Issue
Block a user