mirror of
https://github.com/chenyme/grok2api.git
synced 2026-12-05 16:02:12 +00:00
59 lines
1.9 KiB
YAML
59 lines
1.9 KiB
YAML
services:
|
|
grok2api:
|
|
container_name: grok2api
|
|
image: ghcr.io/chenyme/grok2api:latest
|
|
ports:
|
|
- "${HOST_PORT:-8000}:${SERVER_PORT:-8000}"
|
|
environment:
|
|
TZ: Asia/Shanghai
|
|
LOG_LEVEL: ${LOG_LEVEL:-INFO}
|
|
SERVER_HOST: ${SERVER_HOST:-0.0.0.0}
|
|
SERVER_PORT: ${SERVER_PORT:-8000}
|
|
SERVER_WORKERS: ${SERVER_WORKERS:-1}
|
|
SERVER_STORAGE_TYPE: ${SERVER_STORAGE_TYPE:-local}
|
|
SERVER_STORAGE_URL: ${SERVER_STORAGE_URL:-}
|
|
# 启用 CF 自动刷新: 取消以下三行注释,并取消底部 flaresolverr 服务的注释
|
|
# FLARESOLVERR_URL: http://flaresolverr:8191
|
|
# CF_REFRESH_INTERVAL: "600"
|
|
# CF_TIMEOUT: "60"
|
|
|
|
# SERVER_STORAGE_TYPE: (local, redis, mysql, pgsql) default: local
|
|
# SERVER_STORAGE_URL: (local mode is empty) default: empty
|
|
# Redis: redis://localhost:6379/0 or redis://:password@localhost:6379/0
|
|
# MySQL: mysql+aiomysql://user:pass@localhost/db
|
|
# PgSQL: postgresql+asyncpg://user:pass@localhost/db
|
|
command:
|
|
- sh
|
|
- -c
|
|
- >
|
|
granian --interface asgi --host "$${SERVER_HOST:-0.0.0.0}"
|
|
--port "$${SERVER_PORT:-8000}" --workers "$${SERVER_WORKERS:-1}" main:app
|
|
volumes:
|
|
- ./data:/app/data
|
|
- ./logs:/app/logs
|
|
restart: unless-stopped
|
|
|
|
# 如果出口 IP 不干净,可取消以下注释使用 Warp 作为落地代理
|
|
# 启用后将 proxy.base_proxy_url 设为 socks5://warp:1080
|
|
# warp:
|
|
# container_name: warp
|
|
# image: caomingjun/warp:latest
|
|
# restart: unless-stopped
|
|
# ports:
|
|
# - "127.0.0.1:1080:1080"
|
|
# environment:
|
|
# - WARP_SLEEP=2
|
|
# cap_add:
|
|
# - NET_ADMIN
|
|
|
|
# 启用 CF 自动刷新时取消以下注释
|
|
# flaresolverr:
|
|
# container_name: flaresolverr
|
|
# image: ghcr.io/flaresolverr/flaresolverr:latest
|
|
# ports:
|
|
# - "127.0.0.1:8191:8191"
|
|
# environment:
|
|
# TZ: Asia/Shanghai
|
|
# LOG_LEVEL: info
|
|
# restart: unless-stopped
|