5
3

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.

環境:Amazon linux

DockerとDocker-composeをインストール

####dockerをインストール

sudo yum update
sudo yum install docker

サービス起動:

sudo yum service docker start

ユーザに権限追加

sudo usermod -a -G docker $USER

サーバが再接続してからdockerを使えるようになります

####docker-composeをインストール

# 一時的にスーパーユーザーになる
$ sudo -i

# ここから一時的にスーパーユーザー ----
$ curl -L "https://github.com/docker/compose/releases/download/1.11.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

# docker-compose コマンドに実行権限付与
$ chmod +x /usr/local/bin/docker-compose

# スーパーユーザーを抜ける
$ exit
# スーパーユーザーここまで ----

# docker-compose コマンドの実行確認
$ docker-compose --version
docker-compose version 1.11.2, build dfed245

####補足

# Shortcut追加
alias d='docker'
alias dc='docker-compose'

Re:Dash構築

ソースクローン

# クローンプロジェクト
git clone https://github.com/getredash/redash.git redash

cd redash

docker-compose.ymlファイルを修正

docker-compose.yml
version: '2'
services:
  server:
    image: redash/redash:latest
    command: server
    depends_on:
      - postgres
      - redis
    ports:
      - "5000:5000"
    environment:
      PYTHONUNBUFFERED: 0
      REDASH_LOG_LEVEL: "INFO"
      REDASH_REDIS_URL: "redis://redis:6379/0"
      REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
      REDASH_COOKIE_SECRET: [YOUR SECRET KEY]
      REDASH_WEB_WORKERS: 4
      REDASH_HOST: "http://[YOUR HOST NAME]"
      REDASH_ALLOW_SCRIPTS_IN_USER_INPUT: "true"
      REDASH_CSV_WRITER_ENCODING: "utf-8"
    restart: always
  worker:
    image: redash/redash:latest
    command: scheduler
    environment:
      PYTHONUNBUFFERED: 0
      REDASH_LOG_LEVEL: "INFO"
      REDASH_REDIS_URL: "redis://redis:6379/0"
      REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
      QUEUES: "queries,scheduled_queries,celery"
      WORKERS_COUNT: 2
      REDASH_CSV_WRITER_ENCODING: "utf-8"
    restart: always
  redis:
    image: redis:3.0-alpine
    restart: always
  postgres:
    image: postgres:9.5.6-alpine
    volumes:
      - /opt/postgres-data:/var/lib/postgresql/data
    restart: always
  nginx:
    image: redash/nginx:latest
    ports:
      - "80:80"
    depends_on:
      - server
    links:
      - server:redash
    restart: always

サービスをupします

dc up -d

DB構築設定

# npm install
# optional: run npm via docker image
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/app -w /usr/src/app node:latest npm install

dc run --rm server create_db

まとめ

  • DockerとDocker-composeで構築するので早く出来上がります
  • REDASH_CSV_WRITER_ENCODING: "utf-8"を設定するとCSVをダウンロードできますが、Excelで開くと文字化けになります。cp932を設定すると時々ダウンロードできないんですが文字化けしない

以上です。

5
3
2

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
5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?