本文最后更新于 205 天前,其中的信息可能已经有所发展或是发生改变。
上午在loc看到的,然后打了十几盘后就有了自己搭一个的想法,项目地址
本教程环境为CentOS7,其他环境仅供参考
一、Docker安装(推荐)
安装Docker及docker-compose
yum install -y yum-utils device-mapper-persistent-data lvm2
wget -O /etc/yum.repos.d/docker-ce.repo https://download.docker.com/linux/centos/docker-ce.repo
# 使用清华源加速
sed -i 's+download.docker.com+mirrors.tuna.tsinghua.edu.cn/docker-ce+' /etc/yum.repos.d/docker-ce.repo
yum install docker-ce docker-compose
systemctl enable docker
systemctl start docker
使用国内hub镜像
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s https://hub-mirror.c.163.com
systemctl restart docker
部署
先拉取项目
yum -y install git
git clone https://github.com/skidding/flatris
配置默认设置
cd flatris
mv .env.example.js .env.js
部署
docker-compose up -d
可按照需求修改docker-compose.yml内的端口(默认3000
二、直接安装
准备
由于默认源的nodejs版本过老,需要从官方安装10+版本
NodeJS 14.x 官方源
curl -sL https://rpm.nodesource.com/setup_14.x | bash -
随后安装nodejs、yarn
yum -y install gcc-c++ make nodejs
curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo
yum -y install yarn
拉取项目
yum -y install git
git clone https://github.com/skidding/flatris
开始配置
# 进入项目文件夹
cd flatris
mv .env.example.js .env.js
# 安装
yarn install
# 构建
yarn build
# 启动
yarn start
默认运行在3000端口
然后你就可以和朋友一起来愉快刺激的俄罗斯方块大战了(雾