烧瑚烙饼

烧瑚烙饼

Super cute front-end and back-end separated blog deployment on mix space that monkeys may not necessarily understand.

Configuration Environment#

Install Docker and Docker Compose#

It is recommended to use the root account here.

Update software sources#

apt update
apt upgrade

Install necessary dependencies#

apt install curl unzip vim

Install Docker and Docker Compose#

In China:

export DOWNLOAD_URL="https://mirrors.tuna.tsinghua.edu.cn/docker-ce"
curl -fsSL https://get.docker.com/ | sudo -E sh

Outside China:

curl -fsSL https://get.docker.com | bash -s docker

Check installation#

Use the following commands:

docker -v
docker compose version

If there is output, it means the installation is successful.

If you receive a prompt similar to Command 'docker' not found (use translation wisely), please check the installation steps.

(Optional) Configure image accelerator#

Go to Aliyun to see.

Install Mix Space Backend#

Pull Docker Compose orchestration file#

Use the following command:

cd && mkdir -p mx-space/core && cd $_
wget https://fastly.jsdelivr.net/gh/mx-space/core@master/docker-compose.yml

Edit environment variables#

In the current directory (mx-space/core), create a file named .env and open it with tools like vim.

Copy the content generated here into .env.

(Optional) Modify the backend open document port#

  app:
    container_name: mx-server
    image: innei/mx-server:latest
    command: sh ./docker-run.sh
    environment:
      - TZ=Asia/Shanghai
      - NODE_ENV=production
      - ALLOWED_ORIGINS
      - JWT_SECRET
      - ENCRYPT_KEY
      - ENCRYPT_ENABLE
    volumes:
      - ./data/mx-space:/root/.mx-space
    ports:
      - '2333:2333'
    depends_on:
      - mongo
      - redis
    links:

This is an excerpt from the orchestration file, where

- '2333:2333'

The port on the left side of the colon corresponds to the port number mapped by the backend to the outside.

Just change the left side (Remember to open the security group)

Containers, start!#

I directly use docker compose up -d to start the containers.

As long as there is no ERROR, it means the startup is successful.

Then, go to http://[IP]:backend-port/qaqdmin to initialize.

Install Frontend#

I'm too lazy to write, why don't you go to the official documentation: [Shiro Theme | Mix Space]

This article is synchronized updated to xLog by Mix Space
The original link is https://laobinghu.top/posts/study/mx-space-delopyment


Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.