mirror of https://github.com/fantasticit/think.git
chore: update docker config
parent
2838dd4e18
commit
bf0826b220
|
@ -15,7 +15,7 @@ COPY --from=builder /app/output/ /app/
|
|||
WORKDIR /app
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
|
||||
RUN npm config set registry https://registry.npmmirror.com
|
||||
RUN set -x \
|
||||
RUN set -x \
|
||||
&& apk update \
|
||||
&& apk add --no-cache tzdata redis \
|
||||
&& chmod +x /app/docker/start.sh \
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
#! /bin/bash
|
||||
# 该脚本只保留生产环境运行所需文件到统一目录
|
||||
if [ ! -f './config/prod.yaml' ]; then
|
||||
echo "缺少 config/prod.yaml 文件,可参考 docker-prod-sample.yaml 进行配置"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 构建
|
||||
pnpm fetch --prod
|
||||
pnpm install
|
||||
pnpm run build
|
||||
|
||||
|
@ -71,7 +76,7 @@ cd ../../
|
|||
# @see https://github.com/typicode/husky/issues/914#issuecomment-826768549
|
||||
cd ${outputDir}
|
||||
npm set-script prepare ""
|
||||
pnpm install -r --prod
|
||||
pnpm install -r --offline --prod
|
||||
cd ../
|
||||
|
||||
echo "${outputDir} 打包完成"
|
||||
|
|
|
@ -29,9 +29,9 @@ server:
|
|||
user: ''
|
||||
password: ''
|
||||
admin:
|
||||
name: 'sytemadmin' # 注意修改
|
||||
password: 'sytemadmin' # 注意修改
|
||||
email: 'sytemadmin@think.com' # 注意修改为真实邮箱地址
|
||||
name: 'admin' # 注意修改
|
||||
password: 'admin' # 注意修改
|
||||
email: 'admin@think.com' # 注意修改为真实邮箱地址
|
||||
|
||||
# 数据库配置
|
||||
db:
|
||||
|
|
|
@ -29,9 +29,9 @@ server:
|
|||
user: ''
|
||||
password: ''
|
||||
admin:
|
||||
name: 'sytemadmin' # 注意修改
|
||||
password: 'sytemadmin' # 注意修改
|
||||
email: 'sytemadmin@think.com' # 注意修改为真实邮箱地址
|
||||
name: 'admin' # 注意修改
|
||||
password: 'admin' # 注意修改
|
||||
email: 'admin@think.com' # 注意修改为真实邮箱地址
|
||||
|
||||
# 数据库配置
|
||||
db:
|
||||
|
|
|
@ -2,13 +2,7 @@
|
|||
### Author:jonnyan404
|
||||
### date:2022年5月22日
|
||||
|
||||
CONFIG_FILE='/app/config/prod.yaml'
|
||||
|
||||
if [ ! -f $CONFIG_FILE ]; then
|
||||
cp -f /app/config/docker-prod-sample.yaml $CONFIG_FILE
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
|
||||
pnpm run pm2
|
||||
pm2 startup
|
||||
pm2 save
|
||||
pm2 logs
|
||||
|
|
|
@ -76,7 +76,7 @@ pm2 save
|
|||
|
||||
### docker-compose
|
||||
|
||||
也可以使用 docker-compose 进行项目部署。首先,根据需要修改 `docker-compose.yml` 中的数据库、Redis 相关用户名、密码等配置,然后,修改 `config/docker-prod-sample.yaml` 中对应的配置。
|
||||
也可以使用 docker-compose 进行项目部署。首先,根据需要修改 `docker-compose.yml` 中的数据库、Redis 相关用户名、密码等配置,然后,从 `config/docker-prod-sample.yaml` 复制出 `config/prod.yaml` 并修改其中对应的配置。
|
||||
|
||||
```bash
|
||||
# 首次安装
|
||||
|
|
Loading…
Reference in New Issue