2
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AWS上にSuperset+MySQL+RedisをDockerを使ってサクッと起動する

Last updated at Posted at 2017-10-20

参考にした記事など

やったこと

前提

1) Docker起動

$ sudo service docker start
$ sudo chkconfig docker on

2) docker-compose.yml

$ git clone https://github.com/amancevice/superset.git
$ cd superset
  • docker-compose.yml
version: '3'
services:
  superset:
    build:
      context: .
      args:
        SUPERSET_VERSION: 0.20.4
    image: amancevice/superset
    ports:
      - 80:8088
    depends_on:
      - mysql
      - redis
    volumes:
      - ./superset:/etc/superset
    restart: always

  mysql:
    container_name: mysql
    image: mysql:5.7
    restart: always
    ports:
      - 3306:3306
    volumes:
      - ./mysql:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: superset
      MYSQL_DATABASE: superset
      MYSQL_USER: superset
      MYSQL_PASSWORD: superset
    command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci

  redis:
    image: redis
    restart: always
    volumes:
      - redis:/data
volumes:
  mysql:
    external: false
  redis:
    external: false
  • ポイントは mysql の commandに --collation-server=utf8_unicode_ci を付けているところです

3) superset_config.py

superset/superset_config.py

import os

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 = 'mysql://superset:superset@mysql:3306/superset?charset=utf8mb4'
SQLALCHEMY_TRACK_MODIFICATIONS = True
SECRET_KEY = 'thisISaSECRET_1234'
ENABLE_PROXY_FIX = True
  • ALBなどを使ってhttpsでアクセスする場合 ENABLE_PROXY_FIX = True がないとhttpにリダイレクトされます

4) 起動

$ docker-compose up -d

5) 管理アカウント作成

$ docker-compose exec superset superset-init
Username [admin]: 
User first name [admin]: 
User last name [user]: 
Email [[email protected]]: 
Password: 
Repeat for confirmation: 

これで作成した管理アカウントでログインできるようになりした

2
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?