Files
ulthon_admin/source/stack/docker-dev-sync/docker-compose.yaml
augushong ddaa0ca5a9 feat(stack): 新增 docker-dev-sync 模式,优化 Windows 下 Docker 开发 I/O 性能
- 新增 source/stack/docker-dev-sync/ 模式目录
- 宿主代码映射到 /var/www/source(bind mount 中转)
- 容器内 rsync 定时同步到 /var/www/html(原生文件系统)
- vendor 由 Docker build 管理,不参与同步
- rsync 使用 --no-perms 避免保留 Windows 源文件权限
- 排除 docker-dev/、runtime/、.git/ 等无关目录
- SYNC_INTERVAL 环境变量可配置轮询间隔(默认 3 秒)
- 更新 stack.json 注册模式并声明 sync.sh 为托管文件
- 调整 CI 构建流程:先安装依赖再切换 stack 模式
2026-06-01 22:32:29 +08:00

60 lines
1.6 KiB
YAML
Raw 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.

# 一般不需要配置name默认是目录名但是如果你的系统中有同名的目录需要手动配置
# name: ulthon_admin
services:
ulthon_admin:
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
ports:
- "8000:8000"
volumes:
# Host code mounted to staging area (not the runtime directory)
# sync.sh will rsync from here to /var/www/html
- ./:/var/www/source
environment:
# Sync polling interval in seconds (default: 3)
- SYNC_INTERVAL=${SYNC_INTERVAL:-3}
extra_hosts:
- "host.docker.internal:host-gateway"
depends_on:
mysql:
condition: service_healthy
mysql:
image: mysql:8.0
restart: unless-stopped
ports:
- "13306:3306"
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: ulthon
volumes:
- ./docker-dev/mysql:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
restart: unless-stopped
ports:
- "16379:6379"
volumes:
- ./docker-dev/redis:/data
phpmyadmin:
image: phpmyadmin:latest
restart: unless-stopped
ports:
- "18888:80"
environment:
PMA_HOST: mysql
depends_on:
mysql:
condition: service_healthy