mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-28 05:46:36 +08:00
196bdabc80
- Restructure docs/deployment/server.md into Docker (Quick Start, Production Recommended, Advanced with Jaeger) and Local deployment. - Update docs/guide/quick-start.md default docker-compose to use PostgreSQL, Redis, and ClickHouse as default.
141 lines
3.7 KiB
YAML
141 lines
3.7 KiB
YAML
services:
|
|
openflare:
|
|
build:
|
|
context: .
|
|
dockerfile: docker/Dockerfile
|
|
args:
|
|
VERSION: v0.9.9
|
|
# image: ghcr.io/rain-kl/openflare-server:latest
|
|
restart: unless-stopped
|
|
env_file: .env
|
|
environment:
|
|
TZ: ${TZ:-Asia/Shanghai}
|
|
OTEL_EXPORTER_OTLP_ENDPOINT: ${OTEL_EXPORTER_OTLP_ENDPOINT:-http://jaeger:4317}
|
|
OTEL_EXPORTER_OTLP_INSECURE: ${OTEL_EXPORTER_OTLP_INSECURE:-true}
|
|
OTEL_SAMPLING_RATE: ${OTEL_SAMPLING_RATE:-1.0}
|
|
ports:
|
|
- "3000:3000"
|
|
volumes:
|
|
- ./uploads:/app/uploads
|
|
- ./data/sqlite:/app/data
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
clickhouse:
|
|
condition: service_healthy
|
|
jaeger:
|
|
condition: service_started
|
|
|
|
postgres:
|
|
image: postgres:17-alpine
|
|
restart: unless-stopped
|
|
ports:
|
|
- "5432:5432"
|
|
environment:
|
|
POSTGRES_DB: openflare
|
|
POSTGRES_USER: openflare
|
|
POSTGRES_PASSWORD: replace-with-strong-password
|
|
volumes:
|
|
- ./data/postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U openflare -d openflare"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
redis:
|
|
image: valkey/valkey:8.0-alpine
|
|
restart: unless-stopped
|
|
command: ["valkey-server", "--appendonly", "yes"]
|
|
ports:
|
|
- "${REDIS_PORT:-6379}:6379"
|
|
volumes:
|
|
- ./data/valkey:/data
|
|
healthcheck:
|
|
test: ["CMD", "valkey-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 5s
|
|
|
|
jaeger:
|
|
image: jaegertracing/jaeger:${JAEGER_VERSION:-2.19.0}
|
|
restart: unless-stopped
|
|
environment:
|
|
TZ: ${TZ:-Asia/Shanghai}
|
|
ports:
|
|
- "${JAEGER_UI_PORT:-16686}:16686"
|
|
- "${JAEGER_OTLP_GRPC_PORT:-4317}:4317"
|
|
- "${JAEGER_OTLP_HTTP_PORT:-4318}:4318"
|
|
|
|
clickhouse:
|
|
image: clickhouse/clickhouse-server:25.3-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
CLICKHOUSE_DB: openflare
|
|
CLICKHOUSE_USER: default
|
|
CLICKHOUSE_PASSWORD: 123456
|
|
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: 1
|
|
TZ: ${TZ:-Asia/Shanghai}
|
|
ports:
|
|
- "${CLICKHOUSE_HTTP_PORT:-8123}:8123"
|
|
- "${CLICKHOUSE_NATIVE_PORT:-9000}:9000"
|
|
volumes:
|
|
- ./data/clickhouse_data:/var/lib/clickhouse
|
|
healthcheck:
|
|
test: ["CMD", "clickhouse-client", "--query", "SELECT 1"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 15s
|
|
|
|
agent:
|
|
build:
|
|
context: .
|
|
dockerfile: docker/Dockerfile.agent
|
|
container_name: openflare-agent
|
|
restart: unless-stopped
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
- "127.0.0.1:18081:18081"
|
|
volumes:
|
|
- ./data/agent/:/data
|
|
environment:
|
|
OPENFLARE_SERVER_URL: "http://host.docker.internal:3000"
|
|
OPENFLARE_AGENT_TOKEN: "3f7b66c9329a0cf253e71a86681223aa"
|
|
LOG_LEVEL: "debug"
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
|
|
relay:
|
|
build:
|
|
context: .
|
|
dockerfile: docker/Dockerfile.relay
|
|
container_name: openflare-relay
|
|
network_mode: host
|
|
restart: unless-stopped
|
|
volumes:
|
|
- ./data/relay/:/app/data
|
|
environment:
|
|
OPENFLARE_SERVER_URL: http://host.docker.internal:3000
|
|
OPENFLARE_DISCOVERY_TOKEN: 85464eeb72c49abc430569d6b9c77f78
|
|
LOG_LEVEL: "debug"
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
|
|
flared:
|
|
build:
|
|
context: .
|
|
dockerfile: docker/Dockerfile.flared
|
|
container_name: openflare-flared
|
|
network_mode: "host"
|
|
restart: unless-stopped
|
|
volumes:
|
|
- ./data/flared/:/app/data
|
|
environment:
|
|
OPENFLARE_SERVER_URL: "http://host.docker.internal:3000"
|
|
OPENFLARE_TUNNEL_TOKEN: deb0783ac1e264a9d86440169aca0f09
|