Skip to content

Commit

Permalink
fix docker upload config
Browse files Browse the repository at this point in the history
  • Loading branch information
wangshiyouyang committed Jun 21, 2024
1 parent f03414a commit a4eef6d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions Install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ sec_key=$(openssl rand -hex 16)
env_content=$(echo "$env_content" | sed "s/SEC_KEY/$sec_key/g")
# save .env file
echo "$env_content" > .env
echo "DATA_SOURCE_FILE_DIR=/app/user_upload_files" >> .env
cp Dockerfile.template Dockerfile
# save env file over
echo "You setting as fellows:"
Expand Down
1 change: 1 addition & 0 deletions Install_CN.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ sec_key=$(openssl rand -hex 16)
env_content=$(echo "$env_content" | sed "s/SEC_KEY/$sec_key/g")
# save .env file,保存文件
echo "$env_content" > .env
echo "DATA_SOURCE_FILE_DIR=/app/user_upload_files" >> .env
# 修改配置 pip 为国内清华源
sed 's/#CN#//g' Dockerfile.template > Dockerfile
# 输出说明:
Expand Down
6 changes: 1 addition & 5 deletions ai/backend/util/base_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pathlib import Path

# from bi.settings import DATA_SOURCE_FILE_DIR as docker_data_source_file_dir
docker_data_source_file_dir = "./user_upload_files"
docker_data_source_file_dir = "/app/user_upload_files"

host_secret = 'tNGoVq0KpQ4LKr5WMIZM'
db_secret = 'aCyBIffJv2OSW5dOvREL'
Expand All @@ -28,12 +28,8 @@ def get_upload_path():
else:
# 获取当前工作目录的路径
current_directory = Path.cwd()

# 获取当前工作目录的父级目录
# parent_directory = current_directory.parent
data_source_file_dir = str(current_directory) + '/user_upload_files/'

# data_source_file_dir = '/app/user_upload_files/'
return data_source_file_dir


Expand Down
2 changes: 1 addition & 1 deletion bi/settings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
DATA_SOURCE_FILE_DIR = os.environ.get("DATA_SOURCE_FILE_DIR")
if DATA_SOURCE_FILE_DIR is None or "" == DATA_SOURCE_FILE_DIR:
DATA_SOURCE_FILE_DIR = "./user_upload_files"
print("--------bi_init-- upload_files-----------", DATA_SOURCE_FILE_DIR)

STATSD_HOST = os.environ.get("DEEPBI_STATSD_HOST", "127.0.0.1")
STATSD_PORT = int(os.environ.get("DEEPBI_STATSD_PORT", "8125"))
Expand Down Expand Up @@ -494,4 +495,3 @@ def email_server_is_configured():
BLOCKED_DOMAINS = set_from_string(os.environ.get("DEEPBI_BLOCKED_DOMAINS", ""))

AI_WEB_SERVER = os.environ.get('AI_WEB_SERVER', '127.0.0.1:8340')

0 comments on commit a4eef6d

Please sign in to comment.