version: '3.8' services: redis: image: redis:7-alpine container_name: ${REDIS_HOST} restart: always command: redis-server --appendonly yes ${REDIS_PASSWORD:+--requirepass ${REDIS_PASSWORD}} volumes: - redis-data:/data networks: - rtsp-network 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 environment: TZ: ${TZ} MODEL_DIR: /app/models volumes: - ./python-inference-service/models:/app/models networks: - rtsp-network 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 extra_hosts: - "host.docker.internal:host-gateway" depends_on: redis: condition: service_healthy python-service: condition: service_started environment: TZ: ${TZ} SPRING_DATASOURCE_URL: jdbc:mysql://host.docker.internal:${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: ${REDIS_HOST} SPRING_DATA_REDIS_PORT: ${REDIS_PORT} SPRING_DATA_REDIS_PASSWORD: ${REDIS_PASSWORD} PYTHON_API_URL: http://${PYTHON_SERVICE_HOST}:${PYTHON_SERVICE_PORT} volumes: - backend-logs:/app/logs - backend-upload:/app/upload networks: - rtsp-network healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"] interval: 30s timeout: 10s retries: 5 start_period: 60s frontend: build: context: ./rtsp-vue dockerfile: Dockerfile args: BACKEND_API_URL: http://${BACKEND_HOST}:${BACKEND_PORT} container_name: rtsp-frontend restart: always ports: - "${FRONTEND_PORT}:80" depends_on: backend: condition: service_healthy environment: TZ: ${TZ} networks: - rtsp-network healthcheck: test: ["CMD", "curl", "-f", "http://localhost:80"] interval: 30s timeout: 10s retries: 3 networks: rtsp-network: driver: bridge volumes: redis-data: backend-logs: backend-upload: