Files
server/docker-compose.yml
2025-11-01 16:18:57 +08:00

117 lines
2.7 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.
version: '3.8'
services:
# 主应用服务
app:
build:
context: .
dockerfile: Dockerfile
container_name: digital-archive-app
ports:
- "9081:9081"
volumes:
# 持久化数据目录
- ./data/upload:/app/data/upload
- ./data/temp:/app/data/temp
- ./data/unzip:/app/data/unzip
- ./data/images:/app/data/images
- ./data/reports:/app/data/reports
- ./logs:/app/logs
environment:
- SPRING_PROFILES_ACTIVE=prod
- SERVER_PORT=9081
# 数据库配置
- DB_HOST=database
- DB_PORT=54321
- DB_NAME=enterprise_digital_archives
- DB_USERNAME=system
- DB_PASSWORD=12345678ab
# Redis配置
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_PASSWORD=Abc123456
# Elasticsearch配置 - 使用已有的 "es" 容器
- ELASTICSEARCH_HOST=es
- ELASTICSEARCH_PORT=9200
- ELASTICSEARCH_SCHEME=http
# OCR配置
- TESS_PATH=/usr/bin/tesseract
# 其他配置
- SWAGGER_SHOW=false
- LOG_ROOT_LEVEL=info
- LOG_APP_LEVEL=info
depends_on:
- database
- redis
networks:
- proxy
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9081/point-strategy/actuator/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
# 人大金仓数据库(示例)
database:
image: kingbase:v8.6.0
container_name: digital-archive-db
ports:
- "54321:54321"
environment:
- KINGBASE_USER=system
- KINGBASE_PASSWORD=12345678ab
- KINGBASE_DATABASE=enterprise_digital_archives
volumes:
- ./data/database:/var/lib/kingbase/data
- ./init-scripts:/docker-entrypoint-initdb.d
networks:
- proxy
restart: unless-stopped
# Redis缓存
redis:
image: redis:6-alpine
container_name: digital-archive-redis
ports:
- "6379:6379"
command: redis-server --requirepass Abc123456
volumes:
- ./data/redis:/data
networks:
- proxy
restart: unless-stopped
# Elasticsearch - 使用已有的 "es" 容器
# 注意:确保已有的 "es" 容器已连接到 proxy 网络
# Nginx反向代理可选
nginx:
image: nginx:alpine
container_name: digital-archive-nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/ssl:/etc/nginx/ssl
depends_on:
- app
networks:
- proxy
restart: unless-stopped
networks:
proxy:
external: true
volumes:
upload-data:
temp-data:
unzip-data:
images-data:
reports-data:
database-data:
redis-data:
elasticsearch-data: