Skip to content

Commit cd156dc

Browse files
wang-hqcloud
andauthored
Demo without gpu (#4)
* modified: .github/workflows/deploy.yml modified: docker-compose.demo.yml deleted: docs/MIGRATION_SUMMARY.md new file: docs/deployment/CI_CD_DIAGRAM.md new file: scripts/login-tencent-registry.sh * modified: .github/workflows/deploy.yml * modified: docker-compose.demo.yml * modified: docker-compose.demo.yml * 更新登录页面、多语言配置和 Docker Compose 配置 * Update localization and Docker configurations - Enhanced error and success messages in the login process with internationalization support. - Updated `docker-compose.demo.yml` to switch from using pre-built images to building from Dockerfiles for the queue worker, app, and markitdown services, improving flexibility in development. --------- Co-authored-by: qcloud <ubuntu@localhost.localdomain>
1 parent 6f5f250 commit cd156dc

File tree

9 files changed

+65
-30
lines changed

9 files changed

+65
-30
lines changed

docker-compose.demo.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ services:
3535
- traefik-logs:/var/log/traefik
3636
labels:
3737
- "traefik.enable=true"
38-
# Traefik 仪表板
39-
- "traefik.http.routers.traefik.rule=Host(`www.deepmedsearch.cloud`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
38+
# Traefik 仪表板(仅匹配仪表板路径,不拦截应用 API)
39+
- "traefik.http.routers.traefik.rule=Host(`www.deepmedsearch.cloud`) && PathPrefix(`/dashboard`)"
4040
- "traefik.http.routers.traefik.entrypoints=websecure"
4141
- "traefik.http.routers.traefik.tls.certresolver=letsencrypt"
4242
- "traefik.http.routers.traefik.service=api@internal"
@@ -137,10 +137,10 @@ services:
137137

138138
queue-worker:
139139
# 使用腾讯云预构建镜像(无需本地编译)
140-
image: jpccr.ccs.tencentyun.com/deepmedsearch/deepmed-search-worker:latest
141-
# build:
142-
# context: .
143-
# dockerfile: Dockerfile.worker
140+
# image: jpccr.ccs.tencentyun.com/deepmedsearch/deepmed-search-worker:latest
141+
build:
142+
context: .
143+
dockerfile: Dockerfile.worker
144144
container_name: deepmed-queue-worker
145145
depends_on:
146146
- redis
@@ -157,8 +157,7 @@ services:
157157
REDIS_URL: ${REDIS_URL:-redis://redis:6379}
158158
# 数据库连接:在容器内必须使用 postgres 服务名而不是 localhost
159159
# 从环境变量提取数据库凭证,但使用 postgres 作为主机名
160-
DATABASE_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@postgres:5432/${POSTGRES_DB:-deepmed}
161-
160+
DATABASE_URL: ${DATABASE_URL}
162161
# 加密密钥(必需:用于解密用户配置的 API keys)
163162
ENCRYPTION_KEY: ${ENCRYPTION_KEY}
164163

@@ -177,10 +176,10 @@ services:
177176
# Next.js 主应用服务
178177
app:
179178
# 使用腾讯云预构建镜像(无需本地编译)
180-
image: jpccr.ccs.tencentyun.com/deepmedsearch/deepmed-search-app:latest
181-
# build:
182-
# context: .
183-
# dockerfile: Dockerfile
179+
# image: jpccr.ccs.tencentyun.com/deepmedsearch/deepmed-search-app:latest
180+
build:
181+
context: .
182+
dockerfile: Dockerfile
184183
container_name: deepmed-app
185184
# 端口配置说明:
186185
# - 生产环境:推荐只通过 Traefik (HTTPS) 访问,注释掉下面的 ports
@@ -255,10 +254,10 @@ services:
255254
start_period: 40s
256255
markitdown:
257256
# 使用腾讯云预构建镜像(无需本地编译)
258-
image: jpccr.ccs.tencentyun.com/deepmedsearch/deepmed-markitdown:latest
259-
# build:
260-
# context: ./docker/markitdown
261-
# dockerfile: Dockerfile
257+
# image: jpccr.ccs.tencentyun.com/deepmedsearch/deepmed-markitdown:latest
258+
build:
259+
context: ./docker/markitdown
260+
dockerfile: Dockerfile
262261
container_name: deepmed-markitdown
263262
restart: always
264263
ports:

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ services:
136136
# 注意:在 Docker 容器内使用服务名 postgres 而不是 localhost
137137
REDIS_URL: ${REDIS_URL:-redis://redis:6379}
138138
# 数据库连接:在容器内必须使用 postgres 服务名而不是 localhost
139-
# 从环境变量提取数据库凭证,但使用 postgres 作为主机名
140-
DATABASE_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@postgres:5432/${POSTGRES_DB:-deepmed}
139+
140+
DATABASE_URL: ${DATABASE_URL}
141141

142142
# 加密密钥(必需:用于解密用户配置的 API keys)
143143
ENCRYPTION_KEY: ${ENCRYPTION_KEY}

src/app/login/page.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ const Login = () => {
146146
});
147147

148148
if (result?.error) {
149-
toast.error("登录失败", {
150-
description: "邮箱或密码错误",
149+
toast.error(t('errors.loginFailed'), {
150+
description: t('errors.loginFailedDescription'),
151151
});
152152
return;
153153
}
@@ -167,8 +167,8 @@ const Login = () => {
167167
}
168168

169169
// 显示成功提示
170-
toast.success("登录成功", {
171-
description: `欢迎回来,${user?.name || user?.email || ''}!`,
170+
toast.success(t('success.loginSuccess'), {
171+
description: t('success.loginSuccessDescription', { name: user?.name || user?.email || '' }),
172172
});
173173

174174
// 延迟跳转,让用户看到成功提示
@@ -177,8 +177,8 @@ const Login = () => {
177177
}, 800);
178178
} catch (error) {
179179
console.error('登录失败:', error);
180-
toast.error("登录失败", {
181-
description: "服务器错误,请稍后重试",
180+
toast.error(t('errors.loginFailed'), {
181+
description: t('errors.serverError'),
182182
});
183183
} finally {
184184
setLoading(false);

src/i18n/locales/ar.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,13 @@
354354
"signUp": "التسجيل"
355355
},
356356
"errors": {
357-
"loginFailed": "فشل تسجيل الدخول"
357+
"loginFailed": "فشل تسجيل الدخول",
358+
"loginFailedDescription": "البريد الإلكتروني أو كلمة المرور غير صحيحة",
359+
"serverError": "خطأ في الخادم، يرجى المحاولة مرة أخرى لاحقًا"
360+
},
361+
"success": {
362+
"loginSuccess": "تم تسجيل الدخول بنجاح",
363+
"loginSuccessDescription": "مرحبًا بعودتك، {{name}}!"
358364
},
359365
"login": "تسجيل الدخول",
360366
"loginDescription": "مرحبًا بعودتك! يرجى تسجيل الدخول إلى حسابك.",

src/i18n/locales/en.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,13 @@
465465
"signUp": "Sign Up"
466466
},
467467
"errors": {
468-
"loginFailed": "Login failed"
468+
"loginFailed": "Login failed",
469+
"loginFailedDescription": "Email or password is incorrect",
470+
"serverError": "Server error, please try again later"
471+
},
472+
"success": {
473+
"loginSuccess": "Login successful",
474+
"loginSuccessDescription": "Welcome back, {{name}}!"
469475
},
470476
"login": "Login",
471477
"loginDescription": "Welcome back! Please log in to your account.",

src/i18n/locales/fr.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,13 @@
354354
"signUp": "S'inscrire"
355355
},
356356
"errors": {
357-
"loginFailed": "Échec de la connexion"
357+
"loginFailed": "Échec de la connexion",
358+
"loginFailedDescription": "L'email ou le mot de passe est incorrect",
359+
"serverError": "Erreur serveur, veuillez réessayer plus tard"
360+
},
361+
"success": {
362+
"loginSuccess": "Connexion réussie",
363+
"loginSuccessDescription": "Bon retour, {{name}} !"
358364
},
359365
"login": "Connexion",
360366
"loginDescription": "Bienvenue ! Veuillez vous connecter à votre compte.",

src/i18n/locales/ja.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,13 @@
369369
"signUp": "登録"
370370
},
371371
"errors": {
372-
"loginFailed": "ログインに失敗しました"
372+
"loginFailed": "ログインに失敗しました",
373+
"loginFailedDescription": "メールアドレスまたはパスワードが正しくありません",
374+
"serverError": "サーバーエラーが発生しました。後でもう一度お試しください"
375+
},
376+
"success": {
377+
"loginSuccess": "ログイン成功",
378+
"loginSuccessDescription": "おかえりなさい、{{name}}さん!"
373379
},
374380
"login": "ログイン",
375381
"loginDescription": "おかえりなさい!アカウントにログインしてください。",

src/i18n/locales/ko.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,13 @@
369369
"signUp": "가입하기"
370370
},
371371
"errors": {
372-
"loginFailed": "로그인 실패"
372+
"loginFailed": "로그인 실패",
373+
"loginFailedDescription": "이메일 또는 비밀번호가 올바르지 않습니다",
374+
"serverError": "서버 오류가 발생했습니다. 나중에 다시 시도해 주세요"
375+
},
376+
"success": {
377+
"loginSuccess": "로그인 성공",
378+
"loginSuccessDescription": "돌아오신 것을 환영합니다, {{name}}님!"
373379
},
374380
"login": "로그인",
375381
"loginDescription": "돌아오신 것을 환영합니다! 계정에 로그인하세요.",

src/i18n/locales/zh.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,13 @@
464464
"signUp": "注册"
465465
},
466466
"errors": {
467-
"loginFailed": "登录失败"
467+
"loginFailed": "登录失败",
468+
"loginFailedDescription": "邮箱或密码错误",
469+
"serverError": "服务器错误,请稍后重试"
470+
},
471+
"success": {
472+
"loginSuccess": "登录成功",
473+
"loginSuccessDescription": "欢迎回来,{{name}}!"
468474
},
469475
"login": "登录",
470476
"loginDescription": "欢迎回来!请登录您的账号。",

0 commit comments

Comments
 (0)