version: '3.9' services: # ---------- Redis Celery Broker ---------- selenium-redis-service: image: redis:7.0.5 container_name: selenium-redis-container ports: - "6380:6379" # ---------- 爬虫服务 ---------- selenium-crawl-service: build: ./selenium image: selenium-crawl-image:1.0 container_name: selenium-crawl-container ports: - "5001:5000" environment: API_MODEL: "glm-4.5" API_BASE_URL: "https://open.bigmodel.cn/api/paas/v4" API_KEY: "ce39bdd4fcf34ec0aec75072bc9ff988.hAp7HZTVUwy7vImn" # ---------- Django + Celery ---------- selenium-django-service: build: ./selenium_django image: selenium-django-image:1.0 container_name: selenium-django-container environment: PYTHONUNBUFFERED: 1 CELERY_BROKER_URL: redis://selenium-redis-container:6379/0 CELERY_RESULT_BACKEND: redis://selenium-redis-container:6379/0 # Django 调用爬虫服务的地址 CRAWL_API_URL: http://47.83.141.164:5001 # API 配置 API_MODEL: "glm-4-long" API_BASE_URL: "https://open.bigmodel.cn/api/paas/v4" API_KEY: "ce39bdd4fcf34ec0aec75072bc9ff988.hAp7HZTVUwy7vImn" volumes: - "./selenium_django:/app" depends_on: - selenium-redis-service - selenium-crawl-service ports: - "8002:8000" # ---------- 前端 Vue ---------- selenium-vue-service: build: context: ./selenium_vue # 上一级目录 dockerfile: Dockerfile args: VITE_API_BASE_URL: http://47.83.141.164:8002 # 改为远程 IP VITE_CRAWL_URL: http://47.83.141.164:5001 # 改为远程 IP image: selenium-vue-image:1.0 container_name: selenium-vue-container environment: PORT: 80 NGINX_SERVER_NAME: localhost depends_on: - selenium-crawl-service - selenium-django-service ports: - "8091:80"