pancakeswap 前端源码编译及部署-linux
wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo
yum install yarn -y
yarn --version
wget https://nodejs.org/download/release/v12.20.0/node-v12.20.0-linux-x64.tar.xz
tar xvf node-v12.20.0-linux-x64.tar.xz
mv node-v12.20.0-linux-x64 /usr/local/nodejs
# vim /etc/profile
#nodejs
export NODE_HOME=/usr/local/nodejs
export PATH=$NODE_HOME/bin:$PATH
source /etc/profile
# node -v
v12.20.0
# npm -v
6.14.8
yum -y install git
# git version
git version 1.8.3.1
https://github.com/pancakeswap/pancake-frontend/archive/refs/heads/master.zip
unzip master.zip
# cd pancake-frontend-master/
# ls
CONTRIBUTING.md crowdin.yml cypress cypress.json doc LICENSE netlify.toml package.json public README.md scripts src static.json tsconfig.json yarn.lock
git init
yarn
# ls
CONTRIBUTING.md crowdin.yml cypress cypress.json doc LICENSE netlify.toml node_modules package.json public README.md scripts src static.json tsconfig.json yarn.lock
npm run build
# ls
build CONTRIBUTING.md crowdin.yml cypress cypress.json doc LICENSE netlify.toml node_modules package.json public README.md scripts src static.json tsconfig.json yarn.lock
Couldn't find the binary git
yum -y install git
error extract-files@9.0.0: The engine "node" is incompatible with this module. Expected version "^10.17.0 || ^12.0.0 || >= 13.7.0". Got "10.12.0"
error Found incompatible module.
^10.17.0 || ^12.0.0 || >= 13.7.0
fatal: Not a git repository (or any parent up to mount point /opt)
git init
.git can't be found (see https://git.io/Jc3F9)
error Command failed with exit code 1.
# git init
Initialized empty Git repository in /opt/tools/pancake-frontend-master/.git/
docker pull nginx:1.17.9
mkdir -p /opt/docker/nginx/{conf,html,logs,cert}
# pwd
/opt/docker/nginx
# vim run.sh
#!/bin/bash
docker run -itd --restart=unless-stopped \
-v /etc/localtime:/etc/localtime \
-v /etc/timezone:/etc/timezone \
--network=host \
--name nginx \
-v /opt/docker/nginx/html:/usr/share/nginx/html \
-v /opt/docker/nginx/logs:/var/log/nginx \
-v /opt/docker/nginx/cert:/etc/nginx/cert \
-v /opt/docker/nginx/nginx.conf:/etc/nginx/nginx.conf \
-v /opt/docker/nginx/conf:/etc/nginx/conf.d \
nginx:1.17.9
docker logs -f nginx
# pwd
/opt/docker/nginx
# vim nginx.conf
worker_processes 4;
user nginx;
#pid /opt/app/nginx/sbin/nginx.pid;
events {
worker_connections 409600;
}
http {
include mime.types;
default_type application/octet-stream;
server_tokens off;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
keepalive_timeout 65;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log error;
include /etc/nginx/conf.d/*.conf;
}
# mkdir /opt/docker/nginx/html/pancakeswap -p
# cd /opt/docker/nginx/html/pancakeswap
# cp /opt/tools/pancake-frontend-master/build/* ./ -rf
# ls
asset-manifest.json favicon.ico googlefddf3c367e79f9e2.html images index.html locales logo.png manifest.json _redirects robots.txt static swap.mp3
# pwd
/opt/docker/nginx/conf
# vim www.pancakeswap.com.conf
server {
listen 80;
server_name www.pancakeswap.com;
rewrite ^ https://$http_host$request_uri? permanent;
server_tokens off;
}
server {
listen 443 ssl;
server_name 127.0.0.1;
ssl_certificate /etc/nginx/cert/xxx.com.pem;
ssl_certificate_key /etc/nginx/cert/xxx.com.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
charset utf-8;
location / {
root /usr/share/nginx/html/pancakeswap;
index index.php index.html index.htm;
}
access_log /var/log/nginx/www.pancakeswap.com.log;
error_log /var/log/nginx/www.pancakeswap.com.log;
}
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!