selenium_keyan/docker-compose.yaml

51 lines
1.2 KiB
YAML
Raw Permalink Normal View History

2025-09-25 11:30:08 +00:00
version: '3.9'
services:
# ---------- Redis Celery Broker ----------
redis:
image: redis:7
container_name: redis
ports:
- "6380:6379"
# ---------- 爬虫服务 ----------
selenium:
build: ./selenium
container_name: selenium-crawl-container
ports:
- "5001:5000"
# ---------- Django + Celery ----------
selenium_django:
build: ./selenium_django
container_name: selenium-django-container
environment:
CELERY_BROKER_URL: redis://redis:6379/0
CELERY_RESULT_BACKEND: redis://redis:6379/0
# Django 调用爬虫服务的地址
CRAWL_API_URL: http://47.83.141.164:5001/crawl
depends_on:
- redis
- selenium
ports:
- "8002:8000"
# ---------- 前端 Vue ----------
selenium_vue:
build:
context: ./selenium_vue # 上一级目录
dockerfile: Dockerfile
args:
VITE_API_BASE_URL: http://47.83.141.164:8002
VITE_CRAWL_URL: http://47.83.141.164:5001/crawl
container_name: selenium-vue-container
environment:
PORT: 80
NGINX_SERVER_NAME: localhost
depends_on:
- selenium
- selenium_django
ports:
- "8091:80"