反转旋木

反转旋木

时代的一粒尘埃,落在个人身上就是一座大山

Build this cozy little house

Building this cozy little house#

The reason is that before, I wanted to achieve a hidden effect similar to Moe Girl, and then I saw innei's article.

The effect of implementation is to collect the teacher's blog, and then I don't know how long it took to browse the blog when I was slacking off at work, and I found that innei's blog has been updated to a brand new look. It's so cute, so I want to build one.

Let's get started#

This time, I plan to use the test server assigned by the company for free. Since it is a test server, there is a risk of being destroyed at any time, so I need to deploy the database to my server, and the front end will be deployed on Vercel. Of course, it can also be deployed to the test server. Let's take a shortcut.

It's as simple as the following image. || Let me configure the image bed first. ||
Empty

First, deploy the simplest database#

Because the environment inside is messy, I decided to install MongoDB using Docker.

Just copy docker-compose.yml and grab the medicine as needed.

version: '3.8'

services:
	mongo:
    container_name: mongo
    image: mongo
    volumes:
      - ./data/db:/data/db
    ports:
      - '3344:27017'
    networks:
      - app-network
    restart: always
networks:
  app-network:
    driver: bridge

Just pay attention to a few points:

  1. The port is mapped to 3344 as an external port.
  2. Map the ./data/db directory in the same docker-compose.yml file to /data/db to back up the data just in case.

Since I have already installed Docker and Docker Compose before, I can directly build it in a directory.

docker compose up -d

Next, build the backend of the test server#

Install the environment first here#

node18.2.0

Use NVM to install Node. Why didn't I use Docker? Because I want to compile later || I also want to learn || The commands here are very simple.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
nvm install 18.2.0
nvm use 18.2.0
This is the environment used by default.
nvm alias default stable

Since the test server is a very old version, there was a linking library error that required an upgrade. || Why not just reinstall a new system? Reinstalling would require reporting to HR. ||

[root@172 ~]# npm -v
node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by node)
node: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by node)
node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by node)
node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by node)

Fortunately, there is a blog post from a great person that helped me solve it successfully.

Then you need to compile the backend#

First, git clone it to the server.

git clone  https://github.com/mx-space/core

Then install pnpm package management tool and pm2 tool.

npm install -g pnpm 
npm install -g pm2

Configure the .env file. Modify the code to link to the local MongoDB and Redis. Just search globally.

Then run

pnpm i
pnpm bundle

After successful compilation, the files are all under apps/core/out. Don't panic and run it. The main thing is to pull down the frontend of the management background.

core/apps/core/zip-asset.sh

After that, there will be an out file in the project directory. Go into out.

pm2 start ecosystem.config.js

Okay, if there are no problems with the backend, it has already started. If you want to check, you can use the following interface to ping.

http://configuration-ip:2333/api/v2/ping

Finally, build the frontend (the backend must be built first)#

Actually, you can just follow innei's deployment process.

If you want to deploy locally, it's basically the same as compiling the backend.

This article is synchronized and updated to xLog by Mix Space.
The original link is http://121.41.123.51:2333/posts/categories/1


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