系统 | Centos 8 Stream 纯净系统 [2cpu 4G内存] |
---|---|
域名 | app.hehelucky.cn |
域名SSL证书 | nginx 格式证书 [阿里云和腾讯云都可以申请免费ssl证书] |
数据路径 | /data |
mkdir /data/
cd /data/
dnf install git -y
git clone https://github.com/nineaiyu/flyapps
cd /data/flyapps/docker/init
sh init.sh
a.将域名证书通过sftp软件
或者rz命令
复制到/data/flyapps/nginx.conf.d
目录中
b.将域名证书分别重命名为 域名.pem
和 域名.key
.本次使用的域名是 app.hehelucky.cn
,因此,证书名称类似如下
nginx.conf.d/app.hehelucky.cn.key
nginx.conf.d/app.hehelucky.cn.pem
c.修改NGINX配置文件nginx.conf.d/flyapps-vhost.conf
,将server_name
字段修改为域名,将ssl_certificate
和
ssl_certificate_key
修改为对应证书路径,修改之后,对应字段如下
server_name app.hehelucky.cn;
ssl_certificate /etc/nginx/conf.d/app.hehelucky.cn.pem;
ssl_certificate_key /etc/nginx/conf.d/app.hehelucky.cn.key;
class DOMAINCONF(object):
API_DOMAIN = "https://app.hehelucky.cn" # 用与开启本地存储,上传应用配置
WEB_DOMAIN = "https://app.hehelucky.cn" # 用于超级签跳转配置,该域名一般为前端页面域名
const pro_base_env = {
baseUrl: '/', //该选项可以填写web-api的域名,类似 https://api.xxx.com/
index_static: '/', //若配置cdn等加速,可以填写cdn加速域名
baseShortUrl: '/', //该选项可以填写short-api的域名,也可以和web-api域名一样,类似 https://api.xxx.com/
short_static: '/short/', //若配置cdn等加速,可以填写cdn加速域名
version: version,
};
cd /data/flyapps/docker/scripts
sh build.sh
cd /data/flyapps/docker/scripts
sh start_all.sh
cd /data/flyapps/docker/scripts
sh stop_all.sh
docker exec -it flyapps python manage.py createsuperuser
- 在浏览器输入自己配置的域名 https://app.hehelucky.cn/ 进行访问
- 管理后台访问 https://app.hehelucky.cn:3448/ 进行访问
external_links:
- mariadb:mariadb
- redis:redis
修改为
extra_hosts:
- "mariadb:172.31.31.1"
- "redis:172.31.31.1"
并将nginx:
下面的配置注释掉
同时还需要修改mariadb和redis授权