Upload Dockerfile with huggingface_hub
Browse files- Dockerfile +31 -0
Dockerfile
CHANGED
|
@@ -93,6 +93,37 @@ RUN git clone --depth 1 https://github.com/EKKOLearnAI/hermes-web-ui.git /tmp/he
|
|
| 93 |
cp -r dist node_modules package.json /opt/hermes-web-ui/ && \
|
| 94 |
rm -rf /tmp/hermes-web-ui /root/.npm
|
| 95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
# ==================== 应用代码 ====================
|
| 97 |
WORKDIR /app
|
| 98 |
|
|
|
|
| 93 |
cp -r dist node_modules package.json /opt/hermes-web-ui/ && \
|
| 94 |
rm -rf /tmp/hermes-web-ui /root/.npm
|
| 95 |
|
| 96 |
+
# ==================== 去除 web-ui 默认登录提示 ====================
|
| 97 |
+
# 移除登录页 "默认登录名:admin,默认密码:123456" 提示文字
|
| 98 |
+
# 以及登录后 "请修改默认账户和密码" 弹窗
|
| 99 |
+
RUN python3 -c "
|
| 100 |
+
import os, glob, json
|
| 101 |
+
dist = '/opt/hermes-web-ui/dist'
|
| 102 |
+
# 替换中英文默认凭据提示
|
| 103 |
+
replacements = {
|
| 104 |
+
'默认登录名:admin,默认密码:123456': '',
|
| 105 |
+
'Default credentials: admin / 123456': '',
|
| 106 |
+
'Default login name: admin, default password: 123456': '',
|
| 107 |
+
}
|
| 108 |
+
modified = 0
|
| 109 |
+
for f in glob.glob(f'{dist}/**/*.js', recursive=True):
|
| 110 |
+
try:
|
| 111 |
+
with open(f, 'r', encoding='utf-8') as fp:
|
| 112 |
+
content = fp.read()
|
| 113 |
+
changed = False
|
| 114 |
+
for old, new in replacements.items():
|
| 115 |
+
if old in content:
|
| 116 |
+
content = content.replace(old, new)
|
| 117 |
+
changed = True
|
| 118 |
+
if changed:
|
| 119 |
+
with open(f, 'w', encoding='utf-8') as fp:
|
| 120 |
+
fp.write(content)
|
| 121 |
+
modified += 1
|
| 122 |
+
except Exception:
|
| 123 |
+
pass
|
| 124 |
+
print(f'Login hint patched in {modified} files')
|
| 125 |
+
"
|
| 126 |
+
|
| 127 |
# ==================== 应用代码 ====================
|
| 128 |
WORKDIR /app
|
| 129 |
|