Files
proxy-platform/deployments/docker-compose.yml
T

71 lines
1.5 KiB
YAML

version: '3.8'
services:
postgres:
image: postgres:15-alpine
container_name: proxy-postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: proxy_platform
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: proxy-redis
volumes:
- redis_data:/data
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
scheduler:
build:
context: .
dockerfile: deployments/Dockerfile.scheduler
container_name: proxy-scheduler
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
environment:
- CONFIG_PATH=/app/configs/scheduler.yaml
volumes:
- ./configs:/app/configs
ports:
- "8080:8080" # API
- "1080:1080" # SOCKS5
restart: unless-stopped
# 示例节点 Agent(可选)
agent:
build:
context: .
dockerfile: deployments/Dockerfile.agent
container_name: proxy-agent
depends_on:
- scheduler
environment:
- CONFIG_PATH=/app/configs/agent.yaml
volumes:
- ./configs:/app/configs
restart: unless-stopped
profiles:
- agent # 使用 --profile agent 启动
volumes:
postgres_data:
redis_data: