本地 部署 需要 提 前 请安装 Java 运行环境 (JRE) 。
您可以从 Release
您需
运行
java -jar auth-service-*.jar
docker pull dustlightcn/auth-service:版本 号 (如 1.0.6-alpha-3)
通 过 Docker容器 进行部署 时,可 以通过参数 来 配置 环境变量(例 如:-e key=value
)。环境变量可 以作为应用 配置 被 读取,如-e mysql.host=MYSQ_HOST
。也可以将
application.yaml
配置 文 件 挂载到容器 路 径 /application.yaml
完成 配置 。
具体 配置 方式 请参考 :服 务配置
运行
docker run -e mysql.host=MYSQL_HOST -p 8080:8080 --name auth-service dustlightcn/auth-service:版本 号 (如 1.0.5-alpha)
使用 kubectl
一键部署服务,集 群 中 需要 至 少 两个持久 卷 (PersistentVolume
)用 于 MySQL数 据 库与 Redis的 持久 化 。
kubectl apply -f https://raw.githubusercontent.com/dustlight-cn/auth/master/docs/deploy/k8s/deploy.yaml
详情请
dist/spa
SPA
server {
listen 80 http2;
server_name quasar.myapp.com;
root /home/user/quasar.myapp.com/public;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
index index.html;
charset utf-8;
location / {
try_files $uri $uri/ /index.html;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log off;
error_log /var/log/nginx/quasar.myapp.com-error.log error;
location ~ /\.(?!well-known).* {
deny all;
}
}
其他 Web
正式 部署 时需要 更改 后 端 接 口 的 地 址 ,可 以在js/app.*.js
中 搜索 host:"."
, 并将其替换为后 端 域 名 ,如host:"https://api.dustlight.cn"
。若 需要 更改 更 多 参 数 ,如用户名正 则、谷 歌 验证码 Key,建 议选择手动构建 。(修 改 前 端 项目的 配置 文 件 src/config.ts
)