Files
rtsp-video-analysis-system/docker-compose.yml

91 lines
2.5 KiB
YAML
Raw Permalink Normal View History

2025-09-30 14:23:33 +08:00
version: '3.8'
services:
redis:
image: redis:7-alpine
container_name: ${REDIS_HOST}
restart: always
2025-09-30 20:48:14 +08:00
command: redis-server --appendonly yes --bind 127.0.0.1 ${REDIS_PASSWORD:+--requirepass ${REDIS_PASSWORD}}
network_mode: "host"
2025-09-30 14:23:33 +08:00
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
python-service:
build:
context: ./python-inference-service
dockerfile: Dockerfile
container_name: ${PYTHON_SERVICE_HOST}
restart: always
2025-09-30 20:48:14 +08:00
network_mode: "host"
2025-09-30 14:23:33 +08:00
environment:
TZ: ${TZ}
MODEL_DIR: /app/models
volumes:
- ./python-inference-service/models:/app/models
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
backend:
build:
context: .
dockerfile: ruoyi-admin/Dockerfile
container_name: ${BACKEND_HOST}
restart: always
2025-09-30 20:48:14 +08:00
network_mode: "host"
2025-09-30 14:23:33 +08:00
depends_on:
redis:
condition: service_healthy
python-service:
condition: service_started
environment:
TZ: ${TZ}
2025-09-30 20:10:34 +08:00
SERVER_HOST: ${SERVER_HOST:-localhost}
2025-10-01 17:48:57 +08:00
SERVER_PORT: ${BACKEND_EXTERNAL_PORT}
SERVER_ADDRESS: 0.0.0.0
MEDIA_SERVER_PORT: ${MEDIA_SERVER_EXTERNAL_PORT}
MEDIA_SERVER_ADDRESS: 0.0.0.0
2025-09-30 19:14:28 +08:00
SPRING_DATASOURCE_URL: jdbc:mysql://${MYSQL_HOST}:${MYSQL_PORT}/${MYSQL_DATABASE}?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
2025-09-30 14:23:33 +08:00
SPRING_DATASOURCE_USERNAME: ${MYSQL_USER}
SPRING_DATASOURCE_PASSWORD: ${MYSQL_PASSWORD}
2025-09-30 20:48:14 +08:00
SPRING_DATA_REDIS_HOST: localhost
2025-09-30 14:23:33 +08:00
SPRING_DATA_REDIS_PORT: ${REDIS_PORT}
SPRING_DATA_REDIS_PASSWORD: ${REDIS_PASSWORD}
2025-09-30 20:48:14 +08:00
PYTHON_API_URL: http://localhost:${PYTHON_SERVICE_PORT}
2025-09-30 14:23:33 +08:00
volumes:
- backend-logs:/app/logs
- backend-upload:/app/upload
healthcheck:
2025-10-01 17:48:57 +08:00
test: ["CMD", "curl", "-f", "http://localhost:${BACKEND_EXTERNAL_PORT}/actuator/health"]
2025-09-30 14:23:33 +08:00
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
frontend:
build:
context: ./rtsp-vue
dockerfile: Dockerfile
container_name: rtsp-frontend
restart: always
2025-09-30 20:56:55 +08:00
network_mode: "host"
2025-09-30 14:23:33 +08:00
environment:
TZ: ${TZ}
2025-09-30 20:56:55 +08:00
NGINX_PORT: ${FRONTEND_PORT}
2025-09-30 14:23:33 +08:00
healthcheck:
2025-10-01 17:48:57 +08:00
test: ["CMD", "sh", "-c", "curl -f http://localhost:${FRONTEND_PORT}"]
2025-09-30 14:23:33 +08:00
interval: 30s
timeout: 10s
retries: 3
volumes:
redis-data:
backend-logs:
backend-upload: