Help us understand the problem. What is going on with this article?

mac CatalinaでRedash構築

まえおき

mac Catalina上にRedashを構築したときにいろいろとはまったので手順をメモ

リポジトリをクローン

$ git clone https://github.com/getredash/redash.git
$ git checkout refs/tags/v8.0.0

構築に必要なコマンドをインストール

$ brew install pwgen

Dockerをダウンロードしてインストール

https://download.docker.com/mac/stable/Docker.dmg

ディレクトリの作成

$ sudo mkdir /opt/redash
$ sudo chown $USER:staff /opt/redash
$ mkdir /opt/redash/postgres-data

docker-compose.ymlのコピー

$ cd /opt/redash
$ cp <クローンしたパス>/redash/setup/docker-compose.yml .

DockerのFile sharingにフォルダを追加

スクリーンショット 2020-02-19 23.46.00.png

<クローンしたパス>/redash/setup/setup.shの書き換え

#!/usr/bin/env bash
# This script setups dockerized Redash on Ubuntu 18.04.
set -eu

REDASH_BASE_PATH=/opt/redash

create_config() {
    if [[ -e $REDASH_BASE_PATH/env ]]; then
        rm $REDASH_BASE_PATH/env
        touch $REDASH_BASE_PATH/env
    fi

    COOKIE_SECRET=$(pwgen -1s 32)
    SECRET_KEY=$(pwgen -1s 32)
    POSTGRES_PASSWORD=$(pwgen -1s 32)
    REDASH_DATABASE_URL="postgresql://postgres:${POSTGRES_PASSWORD}@postgres/postgres"

    echo "PYTHONUNBUFFERED=0" >> $REDASH_BASE_PATH/env
    echo "REDASH_LOG_LEVEL=INFO" >> $REDASH_BASE_PATH/env
    echo "REDASH_REDIS_URL=redis://redis:6379/0" >> $REDASH_BASE_PATH/env
    echo "POSTGRES_PASSWORD=$POSTGRES_PASSWORD" >> $REDASH_BASE_PATH/env
    echo "REDASH_COOKIE_SECRET=$COOKIE_SECRET" >> $REDASH_BASE_PATH/env
    echo "REDASH_SECRET_KEY=$SECRET_KEY" >> $REDASH_BASE_PATH/env
    echo "REDASH_DATABASE_URL=$REDASH_DATABASE_URL" >> $REDASH_BASE_PATH/env
}

setup_compose() {
    cd $REDASH_BASE_PATH
    echo "export COMPOSE_PROJECT_NAME=redash" >> ~/.bash_profile
    echo "export COMPOSE_FILE=$REDASH_BASE_PATH/docker-compose.yml" >> ~/.bash_profile
    export COMPOSE_PROJECT_NAME=redash
    export COMPOSE_FILE=$REDASH_BASE_PATH/docker-compose.yml
    sudo docker-compose run --rm server create_db
    sudo docker-compose up -d
}

create_config
setup_compose

setup.shの実行

$ sh <クローンしたパス>/redash/setup/setup.sh

redashにアクセス

ブラウザでhttp://localhost:5000

スクリーンショット 2020-02-19 23.59.50.png

参考文献

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした