# Taurus.Gateway 微服务网关,使用 .Net Core 示例:
下载镜像,当前【2024-01-23 发布的版本是3.3.0.1】:
docker pull registry.cn-hangzhou.aliyuncs.com/taurus-netcore/taurus.gateway:3.3.0.1
下载完成后,查看已下载的镜像列表:
docker images
运行容器,网关需要对外,映射使用80和443端口【默认镜像中的应用打包运行的监听端口为:8080 和 443】:
下面命令行将[ImageID]换成下载的镜像ID
docker run -d -p 80:8080 -p 443:443 --name=gateway --security-opt seccomp=unconfined [ImageID]
启动后,通过以下命令查看容器是否正常运行:
docker ps -a
默认运行环境是当前最新的 .net core 8 版本,程序主要依赖 Taurus.Mvc 的 Nuget 包。
可以根据需要自行创建工程文件,引用 Taurus.Mvc 的 Nuget 包即可,该包支持.net 和 .net core 几乎所有版本。
默认主页显示为:404,没有可显示页面,需要手动输入以下网址进入后台:/admin/login
默认账号:admin,密码空,直接点登陆即可进入后台。
配置项为:MicroService.Server.RcUrl,界面配置始下:
在/admin/config keystrel 配置项中,直接上传证书文件:
zip 可包含一个或多个证书内容如下,如xxx.zip 包含:
证书文件:www.samples.com.pfx
密码文件:www.samples.com.txt
上传成功后,首次需要重启程序,以启动https监听。
网关使用地址:https://github.com/cyq1162/Taurus.RegistryCenter
见:/demo 运行示例。