Files
vinatools/docker/docker-compose.yml
2025-10-15 20:14:12 +08:00

71 lines
1.8 KiB
YAML

version: '3.8'
services:
vinatools:
build:
context: ..
dockerfile: docker/Dockerfile
args:
VINA_VERSION: ${VINA_VERSION:-1.2.7}
VINA_PLATFORM: ${VINA_PLATFORM:-linux}
DOWNLOAD_VINA: ${DOWNLOAD_VINA:-true}
image: vinatools:latest
container_name: vinatools-container
volumes:
# 挂载项目目录到容器
- ..:/app
# 挂载数据目录(用于输入输出文件)
- ./data:/app/data
- ./results:/app/results
working_dir: /app
environment:
- PIXI_ROOT=/root/.pixi
- PATH=/root/.pixi/bin:/app/bin:$PATH
# 保持容器运行
tty: true
stdin_open: true
# 网络模式
network_mode: host
# 重启策略
restart: unless-stopped
# 资源限制
deploy:
resources:
limits:
memory: 4G
cpus: '2.0'
reservations:
memory: 2G
cpus: '1.0'
# 可选:用于 Jupyter Notebook 服务
jupyter:
build:
context: ..
dockerfile: docker/Dockerfile
args:
VINA_VERSION: ${VINA_VERSION:-1.2.7}
VINA_PLATFORM: ${VINA_PLATFORM:-linux_x86_64}
DOWNLOAD_VINA: ${DOWNLOAD_VINA:-true}
image: vinatools:latest
container_name: vinatools-jupyter
ports:
- "8888:8888"
volumes:
- ..:/app
- ./data:/app/data
- ./results:/app/results
working_dir: /app
environment:
- PIXI_ROOT=/root/.pixi
- PATH=/root/.pixi/bin:/app/bin:$PATH
command: >
bash -c "
/root/.pixi/bin/pixi workspace platform add linux-aarch64 &&
/root/.pixi/bin/pixi add jupyter notebook &&
/root/.pixi/bin/pixi run jupyter notebook --ip=0.0.0.0 --port=8888 --no-browser --allow-root --NotebookApp.token='' --NotebookApp.password=''
"
restart: unless-stopped
depends_on:
- vinatools