1 Star 1 Fork 3

perot / YApi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

YApi一键安装 - CentOS 7

自己搭建YApi环境时发现很少有最新版的,YApi没有官方镜像,有些镜像连接甚至被放了挂马挖矿的。安全起见,还是自己从git官方版本上制作好了。

前置条件

  • iptables或firewall开放了3000端口
  • 安装了docker及docker-compose

使用步骤

git clone 本项目
# docker容器的方式
cd yapi-docker && sh install.sh 
# 或者docker-compose的方式
cd yapi-docker-composer && sh install.sh 

其他说明

放开端口参考

#firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --zone=public --add-port={3000/tcp,9090/tcp} --permanent
firewall-cmd --reload
firewall-cmd --list-all

Docker-compose安装参考

# curl -L "https://github.com/docker/compose/releases/download/v2.3.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
curl -L "https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-linux-x86_64" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose -v

关于版本

yapi用了1.10.2版本,拉自国内的gitee的镜像站。版本号可自行在Dockerfile中修改。

基础镜像node12-alpine比较小些 ,yapi依赖乱的一批,node14无法编过。

另外Mongo版本5.0+也会报错,就用了4.4.4版本

# 初始化管理员账号成功,账号名:"admin@admin.com",密码:"ymfe.org"  浏览器打开 http://IP:3000 访问
# 账号可以在各自的config.json里修改(需在镜像制作前)
# 公网环境建议完成初始登录后,增加几个用户后关闭注册。其他配置选项参考官方文档修改config.json后重启即可。
# 排查 docker logs -f yapi_web; docker exec -it yapi_web /bin/sh; init.lock
# https://github.com/vishnubob/wait-for-it/blob/master/wait-for-it.sh
# 如果修改了iptables,需要systemctl docker restart
MIT License Copyright (c) 2022 perot Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

docker/docker-compose 方式安装YApi。 展开 收起
Docker 等 2 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Docker
1
https://gitee.com/perot/yapi.git
git@gitee.com:perot/yapi.git
perot
yapi
YApi
master

搜索帮助