Files
REVOXELSEG_DICOM/docker_compose.yaml

70 lines
2.1 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.
# ReVoxelSeg DICOM 通用 Docker 部署版。
# 默认只启动 Web 服务;如需 FRPC先复制 .env.example 为 .env 并填写参数,
# 再执行docker compose --profile frpc up -d --build
name: revoxelseg-dicom-generic
services:
revoxelseg_web:
image: ${REVOXELSEG_IMAGE:-revoxelseg-dicom:generic}
build:
context: .
dockerfile: Dockerfile
args:
HTTP_PROXY: ${HTTP_PROXY:-}
HTTPS_PROXY: ${HTTPS_PROXY:-}
NO_PROXY: ${NO_PROXY:-localhost,127.0.0.1,revoxelseg_web,revoxelseg_frpc}
restart: unless-stopped
ports:
- "${HOST_PORT:-4000}:4000"
environment:
NODE_ENV: production
PORT: 4000
APP_URL: ${APP_URL:-http://localhost:4000}
TRUST_PROXY: ${TRUST_PROXY:-true}
HTTP_PROXY: ${HTTP_PROXY:-}
HTTPS_PROXY: ${HTTPS_PROXY:-}
http_proxy: ${HTTP_PROXY:-}
https_proxy: ${HTTPS_PROXY:-}
NO_PROXY: ${NO_PROXY:-localhost,127.0.0.1,revoxelseg_web,revoxelseg_frpc}
volumes:
- ${REVOXELSEG_DATA_DIR:-./data}:/app/WebSite/data
- ${REVOXELSEG_EXPORTS_DIR:-./exports}:/app/WebSite/exports
healthcheck:
test: ["CMD-SHELL", "node -e \"fetch('http://127.0.0.1:4000/api/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))\""]
interval: 10s
timeout: 5s
retries: 12
start_period: 20s
revoxelseg_frpc:
image: ${FRPC_IMAGE:-snowdreamtech/frpc:latest}
restart: unless-stopped
profiles:
- frpc
entrypoint: ["/bin/sh"]
command:
- -c
- |
cat > /tmp/frpc.toml <<EOF
serverAddr = "${FRP_SERVER_ADDR}"
serverPort = ${FRP_SERVER_PORT}
auth.method = "${FRP_AUTH_METHOD}"
auth.token = "${FRP_AUTH_TOKEN}"
transport.poolCount = ${FRP_POOL_COUNT}
transport.heartbeatTimeout = ${FRP_HEARTBEAT_TIMEOUT}
[[proxies]]
name = "${FRP_PROXY_NAME}"
type = "tcp"
localIP = "revoxelseg_web"
localPort = 4000
remotePort = ${FRP_REMOTE_PORT}
EOF
exec frpc -c /tmp/frpc.toml
depends_on:
revoxelseg_web:
condition: service_healthy