Detailed Explanation of Docker Deployment and Installation of Redash Chinese Version

  • 2021-09-11 21:47:25
  • OfStack

1 Installation Instructions
Compared with the local installation in Linux environment, the installation mode of Docker is simpler. The scripted installation process of Docker will automatically obtain Redis, postgres and Python3.7 images, and construct the latest background server, worker and schedule images of Redash. Front-end npm dependency package installation and front-end latest code packaging are mounted to server container through volume mapping, so these tasks need to be performed manually once; In addition, the construction of the initial database table structure also requires one manual execution. When these actions are completed, the Docker container can be accessed by starting. Because the installation process needs to access foreign servers, it is extremely difficult to install successfully once, and it needs to be tried several times.
2. Construction of basic environment
1) Replace the domestic source of APT:

sudo sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list

2) Update source:

sudo apt update & & sudo apt upgrade -y

3) Install Docker and Docker-Compose

sudo apt install docker docker-compose -y

4) Replace the domestic source of Docker:


sudo tee /etc/docker/daemon.json>> EOF
{
"registry-mirrors": ["http://registry.docker-cn.com"]
}
EOF

5) Restart the Docker service:

sudosystemctl restart docker

6) Install Nodejs and npm:

sudo apt install nodejsnpm -y

7) Replace the domestic source of npm:

npm config set registry https://registry.npm.taobao.org

8) Upgrade the latest Nodejs version:

sudonpm install n -g & & sudo n stable

3 Start Docker automatic installation execution
1) Download the source code:

git clone https://github.com/dazdata/redash.git & & cd redash

2), Docker installation (if unsuccessful, you need to try again several times):

sudo docker-compose up

4 Automatic post-installation processing
1), front-end npm dependency package installation (warning can be ignored, if error is reported, try again several times):

npm install

2) Front-end packaging:

npm run build

3) Initialize the database table structure:

npm run build

5 Start the system & Initial setting
1) Start the Docker container:

sudo docker-compose start

2) To stop the Docker container:

sudo docker-compose stop

3) Enter the browser:
http://localhost:5000
6 Other notes
1) Initial use:
Please see "Initial Configuration Redash Chinese Version"
2) Subsequent use:
Note that 1 must be executed first

cd redash

Re-execute

sudo docker-compose start

To start the docker container.


Related articles: