Files
MapMil/docker-compose.yml
T
gitrusprusandCursor 5811ecb134 Add VPN admin tab with subscription proxy via cp-vpn for selected sources.
Persist settings in CA, expose /admin/vpn and /internal/vpn, and route Telegram (and optional web/nlp) traffic through mihomo SOCKS when enabled.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-16 23:41:33 +03:00

146 lines
3.7 KiB
YAML

services:
ca-db:
image: postgres:16-alpine
environment:
POSTGRES_USER: mapmil
POSTGRES_PASSWORD: mapmil
POSTGRES_DB: mapmil
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U mapmil -d mapmil"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
redis:
image: redis:7-alpine
restart: unless-stopped
ca-api:
build:
context: .
dockerfile: centers/analytics/api/Dockerfile
env_file:
- .env
environment:
DATABASE_URL: postgresql://mapmil:mapmil@ca-db:5432/mapmil
REDIS_URL: redis://redis:6379/0
INTERNAL_TOKEN: dev-internal-token
TEST_PI_API_KEY: test-pi-api-key-change-me
ADMIN_USER: ${ADMIN_USER:-admin}
ADMIN_PASSWORD: ${ADMIN_PASSWORD:-change-me}
ADMIN_JWT_SECRET: ${ADMIN_JWT_SECRET:-change-me-jwt-secret}
volumes:
- ca_uploads:/data
depends_on:
ca-db:
condition: service_healthy
redis:
condition: service_started
restart: unless-stopped
ca-frontend:
build: ./centers/analytics/frontend
ports:
- "8080:80"
depends_on:
- ca-api
restart: unless-stopped
cp-vpn:
build: ./centers/parsing/vpn
environment:
CA_API_URL: http://ca-api:8000
INTERNAL_TOKEN: ${INTERNAL_TOKEN:-dev-internal-token}
VPN_POLL_SECONDS: "15"
VPN_SOCKS_PORT: "1080"
depends_on:
- ca-api
restart: unless-stopped
cp-workers:
build:
context: .
dockerfile: centers/parsing/workers/Dockerfile
args:
REQUIREMENTS_FILE: requirements.txt
INSTALL_PLAYWRIGHT: "0"
env_file:
- .env
environment:
TELEGRAM_SESSION_PATH: /data/telegram.session
TELEGRAM_LISTENER_ENABLED: "true"
TELEGRAM_LISTENER_REFRESH_SECONDS: "60"
# Env fallback when VPN tab is off (host Happ/xray; socat 11080→10808).
# Overrides .env 127.0.0.1 which is wrong inside the container.
TELEGRAM_PROXY_HOST: host.docker.internal
TELEGRAM_PROXY_PORT: "11080"
CP_VPN_HOST: cp-vpn
CP_VPN_PORT: "1080"
ENABLED_ADAPTERS: telegram
WORKER_FAMILIES: telegram
CA_API_URL: http://ca-api:8000
REDIS_URL: redis://redis:6379/0
INTERNAL_TOKEN: ${INTERNAL_TOKEN:-dev-internal-token}
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ./data:/data
depends_on:
- redis
- ca-api
- cp-vpn
restart: unless-stopped
cp-workers-web:
build:
context: .
dockerfile: centers/parsing/workers/Dockerfile
args:
REQUIREMENTS_FILE: requirements-web.txt
INSTALL_PLAYWRIGHT: "1"
env_file:
- .env
environment:
TELEGRAM_LISTENER_ENABLED: "false"
ENABLED_ADAPTERS: crawl4ai
WORKER_FAMILIES: web
CP_VPN_HOST: cp-vpn
CP_VPN_PORT: "1080"
CA_API_URL: http://ca-api:8000
REDIS_URL: redis://redis:6379/0
INTERNAL_TOKEN: ${INTERNAL_TOKEN:-dev-internal-token}
depends_on:
- redis
- ca-api
- cp-vpn
restart: unless-stopped
cp-workers-nlp:
build:
context: .
dockerfile: centers/parsing/workers/Dockerfile
args:
REQUIREMENTS_FILE: requirements-nlp.txt
INSTALL_PLAYWRIGHT: "0"
environment:
TELEGRAM_LISTENER_ENABLED: "false"
ENABLED_ADAPTERS: viina
WORKER_FAMILIES: nlp
CP_VPN_HOST: cp-vpn
CP_VPN_PORT: "1080"
CA_API_URL: http://ca-api:8000
REDIS_URL: redis://redis:6379/0
INTERNAL_TOKEN: ${INTERNAL_TOKEN:-dev-internal-token}
depends_on:
- redis
- ca-api
- cp-vpn
restart: unless-stopped
volumes:
pgdata:
ca_uploads: