version: '3.8' services: redis: image: redis:7-alpine container_name: ${REDIS_HOST} restart: always command: redis-server --appendonly yes --bind 127.0.0.1 ${REDIS_PASSWORD:+--requirepass ${REDIS_PASSWORD}} network_mode: "host" 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 network_mode: "host" 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 network_mode: "host" depends_on: redis: condition: service_healthy python-service: condition: service_started environment: TZ: ${TZ} SERVER_HOST: ${SERVER_HOST:-localhost} 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 SPRING_DATASOURCE_URL: jdbc:mysql://${MYSQL_HOST}:${MYSQL_PORT}/${MYSQL_DATABASE}?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true SPRING_DATASOURCE_USERNAME: ${MYSQL_USER} SPRING_DATASOURCE_PASSWORD: ${MYSQL_PASSWORD} SPRING_DATA_REDIS_HOST: localhost SPRING_DATA_REDIS_PORT: ${REDIS_PORT} SPRING_DATA_REDIS_PASSWORD: ${REDIS_PASSWORD} PYTHON_API_URL: http://localhost:${PYTHON_SERVICE_PORT} volumes: - backend-logs:/app/logs - backend-upload:/app/upload healthcheck: test: ["CMD", "curl", "-f", "http://localhost:${BACKEND_EXTERNAL_PORT}/actuator/health"] interval: 30s timeout: 10s retries: 5 start_period: 60s frontend: build: context: ./rtsp-vue dockerfile: Dockerfile container_name: rtsp-frontend restart: always network_mode: "host" environment: TZ: ${TZ} NGINX_PORT: ${FRONTEND_PORT} healthcheck: test: ["CMD", "sh", "-c", "curl -f http://localhost:${FRONTEND_PORT}"] interval: 30s timeout: 10s retries: 3 volumes: redis-data: backend-logs: backend-upload: