selenium_keyan/docker-compose.yaml

71 lines
2.0 KiB
YAML
Executable File

version: '3.9'
services:
# ---------- Redis Celery Broker ----------
selenium-redis-service:
image: redis:7.0.5
container_name: selenium-redis-container
restart: always
ports:
- "6380:6379"
# ---------- 爬虫服务 ----------
selenium-crawl-service:
build: ./selenium
image: selenium-crawl-image:1.0
container_name: selenium-crawl-container
restart: always
expose:
- "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
restart: always
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://selenium-crawl-container:5000/crawl
# 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
expose:
- "8000"
# ---------- 前端 Vue ----------
selenium-vue-service:
build:
context: ./selenium_vue
dockerfile: Dockerfile
args:
VITE_BASE_URL: /selenium_web/
VITE_API_BASE_URL: /selenium_api
VITE_CRAWL_URL: /selenium_crawl_api
image: selenium-vue-image:1.0
container_name: selenium-vue-container
restart: always
environment:
PORT: 80
NGINX_SERVER_NAME: localhost
volumes:
- "./selenium_vue/nginx.conf:/etc/nginx/conf.d/default.conf"
depends_on:
- selenium-crawl-service
- selenium-django-service
ports:
- "8091:80"