version: '3.8' services: vinatools: build: context: .. dockerfile: docker/Dockerfile args: VINA_VERSION: ${VINA_VERSION:-1.2.7} image: vinatools:latest container_name: vinatools-container volumes: # 挂载项目目录到容器 - ..:/app # 挂载数据目录(用于输入输出文件) - ./data:/app/data - ./results:/app/results working_dir: /app environment: - PATH=/opt/venv/bin:/usr/local/bin:$PATH # 保持容器运行 tty: true stdin_open: true # 网络模式 network_mode: host # 重启策略 restart: unless-stopped # 覆盖 ENTRYPOINT 用于交互式测试 entrypoint: ["/bin/bash"] command: ["-c", "while true; do sleep 30; done"] # 资源限制 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} # image: vinatools:latest # container_name: vinatools-jupyter # ports: # - "8888:8888" # volumes: # - ..:/app # - ./data:/app/data # - ./results:/app/results # working_dir: /app # environment: # - PATH=/usr/local/bin:$PATH # command: > # bash -c " # pip3 install jupyter notebook && # jupyter notebook --ip=0.0.0.0 --port=8888 --no-browser --allow-root --NotebookApp.token='' --NotebookApp.password='' # " # restart: unless-stopped # depends_on: # - vinatools