-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
start.sh
31 lines (23 loc) · 1016 Bytes
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
set -eux
# 默认资源
if [ ! -d "/mindoc/conf" ]; then mkdir -p "/mindoc/conf" ; fi
if [[ -z "$(ls -A -- "/mindoc/conf")" ]] ; then cp -r "/mindoc/__default_assets__/conf" "/mindoc/" ; fi
if [ ! -d "/mindoc/static" ]; then mkdir -p "/mindoc/static" ; fi
if [[ -z "$(ls -A -- "/mindoc/static")" ]] ; then cp -r "/mindoc/__default_assets__/static" "/mindoc/" ; fi
if [ ! -d "/mindoc/views" ]; then mkdir -p "/mindoc/views" ; fi
if [[ -z "$(ls -A -- "/mindoc/views")" ]] ; then cp -r "/mindoc/__default_assets__/views" "/mindoc/" ; fi
if [ ! -d "/mindoc/uploads" ]; then mkdir -p "/mindoc/uploads" ; fi
if [[ -z "$(ls -A -- "/mindoc/uploads")" ]] ; then cp -r "/mindoc/__default_assets__/uploads" "/mindoc/" ; fi
# 如果配置文件不存在就复制
cp --no-clobber /mindoc/conf/app.conf.example /mindoc/conf/app.conf
# 数据库等初始化
/mindoc/mindoc_linux_amd64 install
# 运行
/mindoc/mindoc_linux_amd64
# # Debug Dockerfile
# while [ 1 ]
# do
# echo "log ..."
# sleep 5s
# done