交付双端基础、实时联系人和隔离浏览器

This commit is contained in:
xhgit committed 2026-11-13 18:03:32 +08:00
1 parent 43687d5e7e
commit 67fef3ff87
59 files changed
+5094 -1

No files matched your search

+60
View File
@@ -0,0 +1,60 @@
name: xhchat
services:
postgres:
image: postgres:18-alpine
environment:
POSTGRES_DB: xhchat
POSTGRES_USER: xhchat
POSTGRES_PASSWORD: ${XHCHAT_DB_PASSWORD:?Set XHCHAT_DB_PASSWORD in .env}
volumes:
- postgres:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U xhchat -d xhchat"]
interval: 5s
timeout: 3s
retries: 15
redis:
image: redis:8-alpine
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 15
api:
build:
context: ./server
args:
GOPROXY: ${XHCHAT_GOPROXY:-https://proxy.golang.org,direct}
environment:
XHCHAT_ADDR: 0.0.0.0:8080
DATABASE_URL: postgres://xhchat:${XHCHAT_DB_PASSWORD}@postgres:5432/xhchat?sslmode=disable
REDIS_URL: redis://redis:6379/0
XHCHAT_ORIGINS: ${XHCHAT_WEB_ORIGIN:-http://127.0.0.1:8080},xhchat://app
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-qO", "/dev/null", "http://127.0.0.1:8080/readyz"]
interval: 5s
timeout: 3s
retries: 15
web:
build:
context: .
dockerfile: web/Dockerfile
depends_on:
api:
condition: service_healthy
ports:
- "127.0.0.1:${XHCHAT_PORT:-8080}:80"
healthcheck:
test: ["CMD", "wget", "-qO", "/dev/null", "http://127.0.0.1/readyz"]
interval: 5s
timeout: 3s
retries: 10
volumes:
postgres: