2026-06-22 12:02:03 +08:00
services :
main :
image : x-financial-dev:latest
container_name : x-financial-main
restart : unless-stopped
environment :
WEB_HOST : 0.0 .0 .0
2026-06-23 09:42:40 +08:00
WEB_PORT : "${WEB_PORT:-5173}"
2026-06-22 12:02:03 +08:00
SERVER_HOST : 0.0 .0 .0
2026-06-23 09:42:40 +08:00
SERVER_PORT : "${SERVER_PORT:-8000}"
2026-06-22 12:02:03 +08:00
SERVER_VENV_DIR : /tmp/x-financial-server-venv
X_FINANCIAL_PREFER_ENV_FILE : "true"
ONLYOFFICE_ENABLED : "${ONLYOFFICE_ENABLED:-false}"
ONLYOFFICE_PUBLIC_URL : "${ONLYOFFICE_PUBLIC_URL:-}"
ONLYOFFICE_BACKEND_URL : "${ONLYOFFICE_BACKEND_URL:-}"
ONLYOFFICE_JWT_SECRET : "${ONLYOFFICE_JWT_SECRET:-x-financial-onlyoffice-dev-secret}"
QDRANT_URL : "${QDRANT_URL:-}"
LIGHTRAG_WORKSPACE : "x_financial_knowledge"
ports :
2026-06-23 09:42:40 +08:00
- "${WEB_PORT:-5173}:${WEB_PORT:-5173}"
2026-06-22 12:02:03 +08:00
- "${SERVER_PORT:-8000}:${SERVER_PORT:-8000}"
- "2223:22"
volumes :
- .:/app
working_dir : /app
command :
- /bin/sh
- -lc
- >
2026-05-21 09:28:33 +08:00
apt-get update &&
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends
2026-06-21 23:23:59 +08:00
python3 python3-pip python3-venv fontconfig openssh-server poppler-data &&
2026-06-06 17:19:07 +08:00
if ! fc-match 'Noto Sans CJK SC' | grep -qi 'Noto'; then if ! timeout "${CJK_FONT_INSTALL_TIMEOUT_SECONDS:-45}" sh -lc 'DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends fonts-noto-cjk fonts-noto-cjk-extra'; then printf '%s\n' '[WARN] CJK font installation timed out or failed; continuing startup without blocking the app.'; fi; fi &&
2026-05-21 09:28:33 +08:00
printf '%s\n'
'<?xml version="1.0"?>'
'<!DOCTYPE fontconfig SYSTEM "fonts.dtd">'
'<fontconfig>'
' <alias><family>SimSun</family><prefer><family>Noto Serif CJK SC</family></prefer></alias>'
' <alias><family>NSimSun</family><prefer><family>Noto Serif CJK SC</family></prefer></alias>'
' <alias><family>KaiTi</family><prefer><family>Noto Serif CJK SC</family></prefer></alias>'
' <alias><family>FangSong</family><prefer><family>Noto Serif CJK SC</family></prefer></alias>'
' <alias><family>SimHei</family><prefer><family>Noto Sans CJK SC</family></prefer></alias>'
' <alias><family>DengXian</family><prefer><family>Noto Sans CJK SC</family></prefer></alias>'
' <alias><family>Microsoft YaHei</family><prefer><family>Noto Sans CJK SC</family></prefer></alias>'
'</fontconfig>'
> /etc/fonts/local.conf &&
fc-cache -f &&
mkdir -p /run/sshd && /usr/sbin/sshd &&
2026-06-22 12:02:03 +08:00
printf '%s\n' 'cd /app >/dev/null 2>&1 || true' > /etc/profile.d/zz-x-financial-app-dir.sh &&
chmod 644 /etc/profile.d/zz-x-financial-app-dir.sh &&
touch /root/.bashrc /root/.profile &&
if ! grep -qxF 'cd /app >/dev/null 2>&1 || true' /root/.bashrc; then printf '\ncd /app >/dev/null 2>&1 || true\n' >> /root/.bashrc; fi &&
if ! grep -qxF 'cd /app >/dev/null 2>&1 || true' /root/.profile; then printf '\ncd /app >/dev/null 2>&1 || true\n' >> /root/.profile; fi &&
sed -i 's/\r$//' /app/start.sh /app/web/web_start.sh /app/server/server_start.sh &&
chmod +x /app/start.sh /app/web/web_start.sh /app/server/server_start.sh &&
cd /app &&
./start.sh all
healthcheck :
2026-06-23 09:42:40 +08:00
test : [ "CMD-SHELL" , "curl -fsS http://127.0.0.1:${WEB_PORT:-5173}/ >/dev/null || exit 1" ]
2026-06-22 12:02:03 +08:00
interval : 15s
timeout : 5s
retries : 10
start_period : 180s
networks :
- financial-internal
networks :
financial-internal :
name : financial-internal