新增功能: - 集成 Cloudflare WARP socks5 代理服务 - 通过环境变量 USE_PROXY 控制代理开关 - 支持自定义 HTTP/HTTPS/SOCKS5 代理服务器 - 使用 docker compose profile 管理 proxy 服务 配置方式: - USE_PROXY=true 启用代理 - ALL_PROXY/HTTP_PROXY/HTTPS_PROXY 自定义代理 - docker compose --profile proxy up 启动 warp 服务 文件变更: - docker-compose.yaml: 添加 warp-proxy 服务 - playwright-auth.ts: 添加代理配置逻辑 - example.env: 添加代理环境变量 - PROXY.md: 使用文档
66 lines
1.5 KiB
YAML
66 lines
1.5 KiB
YAML
services:
|
|
# Warp Socks Proxy Service (Optional - starts with --profile proxy)
|
|
warp-proxy:
|
|
image: ghcr.io/mon-ius/docker-warp-socks:v5
|
|
container_name: dsas-cca-warp-proxy
|
|
restart: unless-stopped
|
|
networks:
|
|
- cca_network
|
|
expose:
|
|
- "9091"
|
|
profiles:
|
|
- proxy
|
|
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: dsas-cca-backend
|
|
ports:
|
|
- "${PORT:-3000}:${PORT:-3000}"
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
- NODE_ENV=production
|
|
- PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
|
|
# Proxy configuration (only active when USE_PROXY=true)
|
|
- USE_PROXY=${USE_PROXY:-false}
|
|
- HTTP_PROXY=${HTTP_PROXY:-}
|
|
- HTTPS_PROXY=${HTTPS_PROXY:-}
|
|
- ALL_PROXY=${ALL_PROXY:-}
|
|
restart: unless-stopped
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
warp-proxy:
|
|
condition: service_started
|
|
required: false
|
|
volumes:
|
|
- ./services/cookies.json:/usr/src/app/services/cookies.json
|
|
networks:
|
|
- cca_network
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
|
|
redis:
|
|
image: "redis:8.0-alpine"
|
|
container_name: dsas-cca-redis
|
|
command: redis-server --requirepass "dsas-cca"
|
|
volumes:
|
|
- redis_data:/data
|
|
restart: unless-stopped
|
|
networks:
|
|
- cca_network
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "-a", "dsas-cca", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
volumes:
|
|
redis_data:
|
|
|
|
networks:
|
|
cca_network:
|
|
driver: bridge
|