selenium_keyan/docker-compose.yaml

71 lines
2.0 KiB
YAML
Raw Normal View History

2025-09-25 11:30:08 +00:00
version: '3.9'
services:
# ---------- Redis Celery Broker ----------
2025-10-12 06:04:28 +00:00
selenium-redis-service:
image: redis:7.0.5
container_name: selenium-redis-container
2025-10-12 10:29:23 +00:00
restart: always
2025-09-25 11:30:08 +00:00
ports:
- "6380:6379"
# ---------- 爬虫服务 ----------
2025-10-12 06:04:28 +00:00
selenium-crawl-service:
2025-09-25 11:30:08 +00:00
build: ./selenium
2025-10-12 06:04:28 +00:00
image: selenium-crawl-image:1.0
2025-09-25 11:30:08 +00:00
container_name: selenium-crawl-container
2025-10-12 10:29:23 +00:00
restart: always
expose:
- "5000"
2025-10-12 05:43:20 +00:00
environment:
API_MODEL: "glm-4.5"
API_BASE_URL: "https://open.bigmodel.cn/api/paas/v4"
API_KEY: "ce39bdd4fcf34ec0aec75072bc9ff988.hAp7HZTVUwy7vImn"
2025-09-25 11:30:08 +00:00
# ---------- Django + Celery ----------
2025-10-12 06:04:28 +00:00
selenium-django-service:
2025-09-25 11:30:08 +00:00
build: ./selenium_django
2025-10-12 06:04:28 +00:00
image: selenium-django-image:1.0
2025-09-25 11:30:08 +00:00
container_name: selenium-django-container
2025-10-12 10:29:23 +00:00
restart: always
2025-09-25 11:30:08 +00:00
environment:
2025-09-29 10:22:44 +00:00
PYTHONUNBUFFERED: 1
2025-10-12 06:04:28 +00:00
CELERY_BROKER_URL: redis://selenium-redis-container:6379/0
CELERY_RESULT_BACKEND: redis://selenium-redis-container:6379/0
2025-09-25 11:30:08 +00:00
# Django 调用爬虫服务的地址
2025-10-12 10:29:23 +00:00
CRAWL_API_URL: http://selenium-crawl-container:5000/crawl
2025-10-12 05:43:20 +00:00
# API 配置
API_MODEL: "glm-4-long"
API_BASE_URL: "https://open.bigmodel.cn/api/paas/v4"
API_KEY: "ce39bdd4fcf34ec0aec75072bc9ff988.hAp7HZTVUwy7vImn"
2025-09-29 10:22:44 +00:00
volumes:
2025-10-17 15:39:00 +00:00
- "./selenium_django/db.sqlite3:/app/db.sqlite3"
2025-09-25 11:30:08 +00:00
depends_on:
2025-10-12 06:04:28 +00:00
- selenium-redis-service
- selenium-crawl-service
2025-10-12 10:29:23 +00:00
expose:
- "8000"
2025-09-25 11:30:08 +00:00
# ---------- 前端 Vue ----------
2025-10-12 06:04:28 +00:00
selenium-vue-service:
2025-09-25 11:30:08 +00:00
build:
2025-10-12 10:29:23 +00:00
context: ./selenium_vue
2025-09-25 11:30:08 +00:00
dockerfile: Dockerfile
args:
2025-10-12 10:29:23 +00:00
VITE_BASE_URL: /selenium_web/
VITE_API_BASE_URL: /selenium_api
VITE_CRAWL_URL: /selenium_crawl_api
2025-10-12 06:04:28 +00:00
image: selenium-vue-image:1.0
2025-09-25 11:30:08 +00:00
container_name: selenium-vue-container
2025-10-12 10:29:23 +00:00
restart: always
2025-09-25 11:30:08 +00:00
environment:
PORT: 80
NGINX_SERVER_NAME: localhost
2025-10-12 10:29:23 +00:00
volumes:
2025-10-13 19:43:15 +00:00
- "./selenium_vue/nginx.conf:/etc/nginx/conf.d/default.conf"
2025-09-25 11:30:08 +00:00
depends_on:
2025-10-12 06:04:28 +00:00
- selenium-crawl-service
- selenium-django-service
2025-09-25 11:30:08 +00:00
ports:
- "8091:80"