Files
team/.devcontainer/docker-compose.display.yml
2026-04-19 21:47:08 +08:00

22 lines
896 B
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# X11 宿主机显示覆盖配置
#
# 此文件始终被 devcontainer.json 加载,通过 DISPLAY_ON_HOST 变量控制行为:
# DISPLAY_ON_HOST=true → 挂载 X11 socket,覆盖 DISPLAY 环境变量
# DISPLAY_ON_HOST=false → 挂载路径为空值(被忽略),不影响主配置
#
# 宿主机准备(Linux:
# 1. 允许本地 X 连接: xhost +local:
# 2. 确认 display: echo $DISPLAY
# 3. 在 .env 中设置 DISPLAY_ON_HOST=true 和 HOST_DISPLAY=$DISPLAY
services:
app:
environment:
DISPLAY_ON_HOST: ${DISPLAY_ON_HOST:-false}
# 仅当 DISPLAY_ON_HOST=true 时,post-create.sh 使用此值替代 Xvfb
HOST_DISPLAY: ${HOST_DISPLAY:-:0}
volumes:
# X11 socket 挂载:始终挂载,容器内脚本按需检测
# 如果宿主机无 X11(如 macOS/Windows),此目录为空,不影响运行
- /tmp/.X11-unix:/tmp/.host-x11