Files
GoProxy/docker-compose.yml
isboyjc a70df0d505 feat: add environment variable support for proxy authentication and geo-blocking
- Introduced `.env.example` for environment variable configuration.
- Updated `docker-compose.yml` to utilize environment variables for proxy settings.
- Implemented proxy authentication with Basic Auth and geo-blocking based on country codes.
- Added `GEO_FILTER.md` for documentation on geo-filtering configuration.
- Enhanced logging to indicate authentication status and blocked countries during proxy server startup.
2026-03-29 04:11:38 +08:00

33 lines
1.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
services:
proxygo:
# 使用预构建镜像(每次部署自动拉取最新版本)
image: ghcr.io/isboyjc/goproxy:latest
pull_policy: always
# 或使用本地构建(取消下面注释,注释上面的 image 和 pull_policy 行)
# build: .
container_name: ${CONTAINER_NAME:-proxygo}
restart: unless-stopped
ports:
# 代理端口:默认仅本地访问(最安全)
# 如需对外开放,在 .env 中设置 PROXY_HOST=0.0.0.0(⚠️ 无认证,需配合防火墙)
- "${PROXY_HOST:-127.0.0.1}:${STABLE_PORT:-7776}:7776" # 稳定代理(最低延迟)
- "${PROXY_HOST:-127.0.0.1}:${RANDOM_PORT:-7777}:7777" # 随机轮换
- "${WEBUI_HOST:-0.0.0.0}:${WEBUI_PORT:-7778}:7778" # WebUI有登录认证
volumes:
- ${DATA_DIR:-./data}:/app/data
environment:
- TZ=${TZ:-Asia/Shanghai}
- DATA_DIR=/app/data
- WEBUI_PASSWORD=${WEBUI_PASSWORD:-goproxy}
- PROXY_AUTH_ENABLED=${PROXY_AUTH_ENABLED:-false}
- PROXY_AUTH_USERNAME=${PROXY_AUTH_USERNAME:-proxy}
- PROXY_AUTH_PASSWORD=${PROXY_AUTH_PASSWORD}
- BLOCKED_COUNTRIES=${BLOCKED_COUNTRIES:-CN}
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:7778/"]
interval: 30s
timeout: 5s
retries: 3