Files
massive-cloud-export/docker-compose.yml
2026-05-11 23:17:14 +08:00

135 lines
4.3 KiB
YAML
Executable File
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.
version: '3.8'
# 宏量点云处理系统 — 目标服务器部署配置
# 使用方法:
# 1. 先执行 load-images.sh 载入镜像
# 2. cp .env.example .env 然后按需修改
# 3. docker-compose up -d
#
# GPU (可选):叠加 GPU overlay:
# 旧版 docker-compose: docker-compose -f docker-compose.yml -f docker-compose.gpu.yml up -d
# Compose V2: docker compose -f docker-compose.yml -f docker-compose.gpu.compose-v2.yml up -d
#
# 端口说明 (host 网络模式,直接占用宿主机端口):
# 应用: 3002
# MySQL: 3307
# MinIO API: 9010
# MinIO 控制台: 9011
services:
app:
image: massive-point-cloud-app-dev:frozen-20260409
container_name: massive-point-cloud-app-dev
working_dir: /app
restart: unless-stopped
network_mode: host
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
environment:
- NODE_ENV=development
- PORT=3002
- DATABASE_URL=mysql://pointcloud:${MYSQL_PASSWORD:-pointcloud_password}@localhost:3307/pointcloud_db
- JWT_SECRET=${JWT_SECRET:-please-change-this-secret-in-production}
- AUTH_MODE=local
- S3_ENDPOINT=http://localhost:9010
- S3_ACCESS_KEY=${MINIO_ROOT_USER:-minioadmin}
- S3_SECRET_KEY=${MINIO_ROOT_PASSWORD:-minioadmin123}
- S3_BUCKET=pointcloud-data
- S3_REGION=us-east-1
- DATA_DIR=/data
- PYTHON3_PATH=/usr/bin/python3
- ASSEMBLY_USE_GPU=1
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
- VITE_APP_TITLE=${VITE_APP_TITLE:-宏量点云处理系统}
- VITE_OAUTH_PORTAL_URL=disabled
- VITE_APP_ID=
- CHOKIDAR_USEPOLLING=true
volumes:
- ./src:/app
- app-node-modules:/app/node_modules
- ${DATA_DIR:-./data}:/data
command: sh -c "corepack enable && corepack prepare pnpm@latest --activate && pnpm install && pnpm dev --host 0.0.0.0"
depends_on:
mysql:
condition: service_healthy
minio:
condition: service_started
mysql:
image: mysql:8.0
container_name: massive-point-cloud-mysql
restart: unless-stopped
network_mode: host
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-root_password_change_me}
- MYSQL_DATABASE=pointcloud_db
- MYSQL_USER=pointcloud
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-pointcloud_password}
- MYSQL_TCP_PORT=3307
volumes:
- mysql-data:/var/lib/mysql
- ./docker/mysql/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-P", "3307", "-u", "root", "-p${MYSQL_ROOT_PASSWORD:-root_password_change_me}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
command: >
--default-authentication-plugin=mysql_native_password
--character-set-server=utf8mb4
--collation-server=utf8mb4_unicode_ci
--port=3307
--sort_buffer_size=33554432
--read_rnd_buffer_size=8388608
--tmp_table_size=67108864
--max_heap_table_size=67108864
minio:
image: minio/minio:latest
container_name: massive-point-cloud-minio
restart: unless-stopped
network_mode: host
environment:
- MINIO_ROOT_USER=${MINIO_ROOT_USER:-minioadmin}
- MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD:-minioadmin123}
volumes:
- minio-data:/data
command: server /data --address ":9010" --console-address ":9011"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9010/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
minio-init:
image: minio/mc:latest
container_name: massive-point-cloud-minio-init
network_mode: host
restart: on-failure
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
mc alias set myminio http://localhost:9010 ${MINIO_ROOT_USER:-minioadmin} ${MINIO_ROOT_PASSWORD:-minioadmin123};
mc mb myminio/pointcloud-data --ignore-existing;
mc anonymous set public myminio/pointcloud-data;
echo 'MinIO bucket initialized';
exit 0;
"
volumes:
mysql-data:
name: pointcloud-mysql-data
minio-data:
name: pointcloud-minio-data
app-node-modules:
name: pointcloud-app-node-modules-dev